Presentation is loading. Please wait.

Presentation is loading. Please wait.

Text Box controls are used when users are required to type some input (during program execution), or output is displayed on the form (known as the user-

Similar presentations


Presentation on theme: "Text Box controls are used when users are required to type some input (during program execution), or output is displayed on the form (known as the user-"— Presentation transcript:

1 Text Box controls are used when users are required to type some input (during program execution), or output is displayed on the form (known as the user- interface when the project is running) To display some text in a Text Box during program execution, assign a literal to the Text Property of the Text Box (Does not have a CAPTION Property) txtMessage.Text = “Hello World” Text Boxes

2 In this example, whatever the user enters into the Text property of the Text Box (txtName) is assigned to the Caption property of the Label (lblName) lblName.Caption = txtName.Text

3 Frames are used as containers for other controls Groups of Option Buttons or Check Boxes can be placed in frames Using frames to group controls makes the forms easier to understand Set a Frames Caption Property to display the words on the user-interface, on the top edge of the Frame Frames

4 Allows the user to select or deselect an option In a group of Check Boxes, any number of them may be selected The Value property of a Check Box is set to 0 if unchecked, 1 if checked, or 2 if disabled (greyed) 0 = vbUnchecked 1 = vbChecked Check Boxes

5 Use only when one Option of a group maybe selected Any Option Buttons placed directly on a Form, function as a Form Group A group of Option Buttons inside a Frame function together as a Frame Group The Value property of an Option Button is set to True if selected, or to False if unselected Option Buttons

6 Images An Image control holds a picture An Images Picture property can be set to a file with an extension of.BMP,.GIF,.JPG

7 Writing Windows Apps. with VB The Windows GUI Text boxes Frame Labels Option buttons Check boxes Command buttons Image Picture box

8 We want to create a program where the height property value of a text box is displayed in the text box, while further printing the contents of the text box onto the form A Practical Example (using Text Boxes)

9 A variable (X) is declared as an integer Data Type, meaning it can only accept numeric values The Text Box is named BoxContents The Variable X is assigned the value of the Height property of BoxContents (Text Box) The Text property of BoxContents consists of a literal and the value of the variable X The Text in BoxContents is also printed on the form

10

11 Before Project Execution During Project Execution

12 Additional Instructions Make the Text Box blank once the contents have been printed Notify the user that the Text Box is blank Add this Code to the End of the Sub-Procedure BoxContents.Text =“” ‘Empties whatever is in the text box Print “The Text Box (BoxContents) is now blank” ‘Prints this message on the form


Download ppt "Text Box controls are used when users are required to type some input (during program execution), or output is displayed on the form (known as the user-"

Similar presentations


Ads by Google