See Also Controls List
A control is an object that you draw on a form You add menu controls to a form using the Menu Design window ; all other controls appear in the Toolbox and are placed on a form by double-clicking them or by clicking and then dragging them onto a form. to enable or enhance user interaction with an application .
Controls accept user input or display output. Controls have properties that define aspects of their appearance, such as position, size, and color, and aspects of their behavior, such as how they respond to user input.
Controls can respond to events For example, you could write code in a command button's Click event procedure that would load a file or perform a calculation and then display the result. initiated by the user or triggered by the system.
In addition to properties and events, you can use methods For example, you can use the Move method with some controls to change their location and size. to manipulate controls from code.
Each control has its own set of properties, events and methods.
Note that the Control keyword is an object type and you can use it to declare a variable of type Control before setting it to a specific control type. You can also declare a procedure parameter to have type Control.
Graphical controls include the image, label, line, and shape controls. A graphical control uses fewer system resources and has different drawing and display characteristics than other controls.
Check box Gives the user a True /False or Yes/No option.
Combo box Enables the user to make a selection by typing text into a text box or by selecting an item from a list.
Command button Chosen by the user to begin or end a process.
Common dialog Provides a standard set of dialog boxes for operations such as opening, saving, and printing files or selecting colors and fonts.
Data control Enables the developer to create applications that view and manipulate databases.
Directory list box Enables the user to select directories and paths at run time.
Drive list box Enables the user to select valid disk drives at run time.
File list box Enables the user to select files at run time.
Frame Provides a functional grouping and container for other controls.
Grid Provides a matrix of spreadsheet-type cells whose contents can be manipulated in code. Grid is a custom control supplied with Visual Basic.
Horizontal scroll bar Allows navigation through lists or forms; also can indicate position in a range.
Image Displays a bitmap , icon , or metafile as a graphic.
Label Displays text the user can't change.
Line Displays itself as a horizontal, vertical, or diagonal line.
List box Displays a list from which the user can select one or more items.
Menu Displays a menu on a form.
OLE control Allows a programmer to create applications that can display and allow editing of data from many different applicationsfor example, objects created by draw, graphics, and spreadsheet applications. Data from another application can be edited within the application in which it was created
Option button As part of a group of option buttons, displays multiple choices from which the user can select only one.
Picture box Displays graphics that are drawn with Circle , Line , and Print methods, or that are loaded from a bitmap, icon, or metafile. Can also act as a container for other controls.
Shape Displays itself as a variety of shapes including boxes, circles, and so on.
Text box Displays text the user can edit.
Timer Enables you to run code at a specified time interval.
Vertical scroll bar Allows navigation through lists or forms; also can indicate position in a range.
Creating a Menu Bar
Drawing a Control
Chapter 3, "Creating and Using Controls"