CyberiaPC.com Main Page




Learning VB

{4} Inserting Command Buttons

Now you'll insert the third and final type of control in your form: Command buttons.

Select the CommandButton tool from the toolbox and draw a small square-shaped command button to the right of lblOperationName the command button cmdAdd and set its Caption to +.  Now draw three more command buttons next to this one with the following properties:

Name: cmdSubtract     Caption: -

Name: cmdDivide     Caption: /

Name: cmdMultiply     Caption: *

You form should look something like this:

In the illustration above, I've change the Font properties of the command buttons by making them Bold and changing the Font Size to 12.

All you have to do now is add two more command buttons at the bottom.  One to perform the calculation and one to clear all text fields.  Here are the properties you should use for the two command buttons:

Name: cmdClear     Caption: Clear

Name: cmdCalculate     Caption: Calculate!

Here is how your final form should look:

Save your work and you're ready for the next step.

{Go To Step 5}