CyberiaPC.com Main Page




Learning VB

{3} Inserting Text Boxes

In this step, we'll add the textboxes to our form.  This will be very similar to the previous step.  Since the text in textboxes can be edited by the user, we'll use them for the first and second numbers: The user will enter the first number in the first textbox, then choose an operation and then enter the second number in the second textbox.  Upon hitting the Calculate button (I'll discuss this later) the calculation will be executed on both numbers.

Select the Text Box tool and draw a textbox to the right of lblFirstNumber.  Now, like before, change it's Name to txtFirstNumber.  You will notice that there is no Caption property.  This is because textboxes store their text in a property called Text.  Find this property and set it to 1.

Repeat this by creating a second textbox to the right of lblSecondNumber.  This time, change its name to txtSecondNumber and set its Text property to 1.

Your form should now look like this:

{Go To Step 4}