Design The Graphical User Interface
Design The Graphical User Interface
Tips:
On the
properties toolbox set
in alphabetical order.
Refer to the picture of
the Toolbox, green
circle.
Step 2: In the properties window, under the Text property, type Simple
Calculator
Step 5: Click and drag a label from the Toolbox to the form
Step 6: While the label is selected, in the properties window, under the
Text property, type Simple Calculator. Note: Since this label is the
main text describing the text, you can change the size and boldness of
the text under the Font property in the properties window but is not
required for this project
Step 7: Proceed to do this for the following labels (5) and place them
accordingly. Name them: Operators, Operation, Operand 1, Operand
2, and Result (See picture) Note: Objects can either be dragged or
double clicked to be placed onto the GUI
Step 10: While the button is selected, in the properties window, under
the Name property, enter btnAdd
Step 12: Click and drag a TextBox from the ToolBox beside the
“Operand 1” label (See picture)
Step 14: Repeat Step 12 but place the second TextBox beside the
“Operand 2” label (See picture)
Step 16: Click and drag a label between the two text boxes (See
picture)
Step 17: While the label is selected, in the properties window, under
the Name property, enter lblOperator
Step 19: Under 9the AutoSize property, select False. Note: This lets
you resize the label at your desire
Step 21: Click and drag another label beside the “Result” label
Step 24: Click and drag a button from the Toolbox below the “Result”
label (See picture)
Step 25: While button is selected, in the properties window, under the
Name property, enter btnClear
Step 26: Change the text property for the Clear button to Clear
Step 27: Click and drag a button from the Toolbox beside the Clear
button (See picture)
Step 28: While button is selected, in the properties window, under the
Name property, enter btnExit
Step 29: Change the text property for the Clear button to Exit
Step 30: Enter the following code by double clicking on each button to
open the code window:
Goal: Add to numbers that the user inputs into the text boxes
Code Explanation
Code Explanation: