Professional Documents
Culture Documents
President Ramon Magsaysay State University: Course Code: Ace 223 - Advance Computer Programming
President Ramon Magsaysay State University: Course Code: Ace 223 - Advance Computer Programming
State University
Iba, Zambales, Philippines
Tel/Fax No.: (047) 811-1683
Introduction
This chapter illustrates how many of the Common Controls within the Visual Basic Toolbox
can be used to develop an exciting application interface
Intended Learning Outcomes
A. Shall be able to learn the different common controls in Visual Basic Toolbox.
COURSE MODULE
Chapter 3:
USING CONTROLS
TAB ORDER
• When creating an application interface with multiple controls consider how it can
be navigated without a mouse, by those users who prefer keyboard navigation.
Typically, they will expect to be able to move the focus from one control to another
by pressing the Tab key. It is, therefore, important to allow the focus to move in a
logical order when the Tab key is pressed, by setting the TabIndex property values
of your controls.
1. Place several controls on a Form, then click on the one you want to be first in the
Tab order to select it.
2. Set the TabIndex property value of the selected control to zero so it has first focus.
3. Repeat for other controls, setting each TabIndex with an ascending value – 1, 2, 3,
and so on.
4. Press the Start button to run the program, then hit the Tab key to see it follow your
chosen order.
USING BUTTON
• The Button control provides the user with an easy way to start an operation, confirm
or cancel a choice, or get help. In Visual Basic, programming code needs to be
added within each Button’s event-handler to determine its function. Also, its
properties need to be set to determine its appearance – Size, Text, Color, Font, etc.
COURSE MODULE
When setting the Text property, you can easily create an access key shortcut by
prefixing the value with an ampersand & character.
1. Select the Button control in the Form Designer then use the Properties window to
modify its Size and Color.
3. Add MsgBox(“Going”) code to the button’s Click event-handler, then run the
program and press Alt + G to test the “Go” button’s access key
USING TEXTBOX
5. Run the application, type some text into the TextBox, then click the Button to test
the application.
USING COMBOBOX
3. Enter a list of alternatives you wish to offer, adding one on each line, then click the
OK button.
COURSE MODULE
USING LABEL
• A Label control is intended to advise the user, and provides a rectangular area that
is generally used to provide text information. It can also provide simple rectangular
graphics by displaying no text value, and setting its AutoSize and BackColor
properties.
3. Select each Label in turn and, in the Properties window, set the BackColor
property value to your preference.
4. Select each Label in turn and, in the Properties window, delete the Text property
value so it becomes blank.
USING PICTUREBOX
4. Click OK to import the image file into your application and to place the image in
the PictureBox control
Assessment/Exercises
Practice by doing example given above on how to apply different common toolbox in
visual basic.