Page 311 - Open Soource Technologies 304.indd
P. 311
Unit 14: Building Small Application
line of the Properties box, which should appear below the project listing by default. Press “Enter”
to accept the new name. Do the same for form (a suggested form name is “CalculatorUI”), making
sure to enter a similar name in the “Caption” property as well, which will change the text in
the top bar of the form. Save the project in a new folder on computer.
3:
Fig. 14.8: Textbox creation on form (ALLD)
Add buttons and a text box to the form. First, add a text box, which will be where the numbers
entered in the calculator appear, as well as the results of calculations. Do this by selecting the
TextBox button from the toolbar at the left side of the screen, and then dragging with mouse the
size and location desire for the TextBox. Once we placed the TextBox we can change the size and
location by dragging it to another location of the form or by dragging the handles (the small
squares) along the border of the TextBox. Be sure to change the following lines in the Properties
window, with the TextBox selected: “(Name)” = tbResult, “Alignment” = 1 - Right Justify, “Data
Format” = (click on the “.” button to select) Number, “Locked” = True, and “Text” = 0.
4:
Fig. 14.9: Button layout for the calculator program (ALLD)
LOVELY PROFESSIONAL UNIVERSITY 305