0% found this document useful (0 votes)
38 views13 pages

Ch2 Part II

DataGridView displays tabular data in rows and columns. Its DataSource binds to data and AllowUserToAddRows adds new records. ImageList stores images for controls like ToolStrip. DateTimePicker selects dates and times using Calendar and Up/Down buttons. MenuStrip replaces standard menus and Toolbars with customizable menus. FontDialog opens a dialog to select fonts.

Uploaded by

speedystories97
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views13 pages

Ch2 Part II

DataGridView displays tabular data in rows and columns. Its DataSource binds to data and AllowUserToAddRows adds new records. ImageList stores images for controls like ToolStrip. DateTimePicker selects dates and times using Calendar and Up/Down buttons. MenuStrip replaces standard menus and Toolbars with customizable menus. FontDialog opens a dialog to select fonts.

Uploaded by

speedystories97
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

Visual Application Development

EN 2013

2nd YEAR 2nd SEMESTER


Sept., 2023

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

• The Label control displays text that cannot be edited by the


user.
• Its primary use is to provide an identifying label for another
control, such as a text box.
• The text in the in a Label control can be changed by means
of the Text property.
• LinkLabel control is specialized for the display of Web links.

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

• The TextBox control displays text that can be edited


by the user.

• It is a very powerful control, and it finds use in many


windows applications.

• The text displayed by this control is not formatted,


and the only appearance changes possible are to
change the font and color of the text displayed.

• For display of formatted text, use the RichTextBox


control.

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

• The CheckBox control displays a caption with an adjacent


box that can be checked or checked to turn an option on
or off.

• Checkbox displays a list of choices and gives the user the


option to pick multiple items (or none at all) from a list of
choices

Property Description

Appearance Set to Normal or Button to specify the appearance of the control

Checked Returns True if the checkbox is in the Checked or Indeterminate state, False otherwise

Text The text displayed in the control’s caption


A boolean value specifying whether the CheckState value changes automatically when the
AutoCheck
Click event occurs
7
Basic Controls
4. RadioButton

• A RadioButton control displays a caption with an


adjacent small dot that can be on or off to specify the
state of an option or other program setting.

• In most ways, it is like the CheckBox control, with


two major differences:
• A RadioButton control cannot have an
indeterminate state – it is either on or off.

• RadioButton controls always come in group of


two or more, and only one radio button in a
group can be “on” at a time.

8
Basic Controls
5. ListBox

• A ListBox control displays a list of text items from which


the user can select one or more.

• If the list contains more items than are visible, the control
displays a scrollbar that lets the user scroll through the list.

• The user selects and deselects items in a list box by clicking


with the mouse or by scrolling through the list.

Property Description

Sorted Items are sorted alphabetically, if the sorted property is True.

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:

• The ComboBox control can be thought of as a


combination of a TextBox and a ListBox control.

• The techniques for adding items to the list portion of


a ComboBox control are the same as for the ListBox
control.

• When the user selects an item in the list portion of


the control, that item is automatically copied to the
text box portion.

• Unlike ListBox control, it doesn’t permit selection of


more than one item at a time.

10
Basic Controls
6. TabControl:

• The TabControl control lets you create a dialog box


that contains multiple pages or tabs.

• Each page is identified by a labeled tab.

• It can be a great help when you want to fit a lot of


functionality into small form.

Property Description

TabPage Keeps track of all of its pages

ItemSize A size structure that specifies the width & height of the tabs

Padding Specifies the padding or space around the tab captions.


11
Basic Controls

7. Timer

• If you want to run some code after a certain interval of time continuously, you can use
the Timer control.

• To start a process at a fixed time schedule, to increase or decrease the speed in an


animation graphics with time schedule also you can use the Timer Control.

Property Description

Enabled Property used to Get or set whether the timer is running.

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

You might also like