Ch2 Part II
Ch2 Part II
EN 2013
1
CHAPTER 02 (Part-II)
2
Basic Controls
• As you learned in Toolbox Controls, controls are the design tools you use to
build the user interface of a Visual Basic program.
• After you place controls on a form, they become objects that you can customize
with property settings and program code.
• In this section, you learn about the most basic user interface controls in the
Visual Basic toolbox.
3
Basic Controls
1. Label
Property Description
AutoSize If this property is set to True, the control automatically resizes to display its contents
BorderStyle Specifies the appearance of the control’s borders. Eg: Fixed 3D, Fixed single
Specifies how text is aligned with respect to the four borders of the control.
TextAlign
Eg: Left 4
Basic Controls
2. TextBox
5
Basic Controls
Commonly needed properties of the TextBox control
Property Description
A Boolean value specifying whether the height of the control automatically changes when the
AutoSize
font size is changed
MaxLength The maximum number of characters that the text box can hold
MultiLine A Boolean value specifying whether the textbox can display multiple lines of text
Set this property to any single character (* ) to have that character display in place of all other
PasswordChar
characters.
ReadOnly If this property is set to True, the user cannot modify the text that is displayed.
TextAlign Specifies how text is aligned with respect to four borders of the control.
AcceptsTab A Boolean value specifying whether the textbox will accept tab characters.
AcceptsReturn A Boolean value specifying whether the textbox will accept Enter.
6
Basic Controls
3. CheckBox
Property Description
Checked Returns True if the checkbox is in the Checked or Indeterminate state, False otherwise
8
Basic Controls
5. ListBox
• If the list contains more items than are visible, the control
displays a scrollbar that lets the user scroll through the list.
Property Description
Items Displays the string collection editor, here items can be able to enter, edit, & delete
Selection of items. Eg: only one item can be selected, MultiExtended multiple adjacent items
SelectionMode
can be selected
9
Basic Controls
6. ComboBox:
10
Basic Controls
6. TabControl:
Property Description
ItemSize A size structure that specifies the width & height of the tabs
7. Timer
• If you want to run some code after a certain interval of time continuously, you can use
the Timer control.
Property Description
Interval Property used to set or get the time in millisecond between the timer clicks.
12
ACTIVITY - 01
Explain the following control tools, by stating their important
properties and their uses.
▪ GroupBox ▪ PictureBox
▪ ProgressBar ▪ DataGridView
▪ Imagelist ▪ DateTimePicker
▪ MenuStrip ▪ FontDialog
Submit this activity in the form of PDF with the clear explanation.
13