CONTROLS OVERVIEW

Figure 7-1 shows the Visual Basic Toolbox displaying the standard Windows Forms controls. Because you can add and remove controls on the Toolbox, you may see a slightly different selection of tools on your computer.

FIGURE 7-1: Visual Basic provides a large number of standard controls for Windows Forms.

image

The following table briefly describes the controls shown in Figure 7-1 in the order in which they appear in the figure (starting at the top, or row 1, and reading from left to right).

CONTROL PURPOSE
Row 1
Pointer This is the pointer tool, not a control. Click this tool to deselect any selected controls on a form. Then you can select new controls.
BackgroundWorker Executes a task asynchronously and notifies the main program of its progress and when it is finished.
BindingNavigator Provides a user interface for navigating through a data source. For example, it provides buttons that let the user move back and forth through the data, add records, delete records, and so forth.
BindingSource Encapsulates a form’s data source and provides methods for navigating through the data.
Button A simple push button. When the user clicks it, the program can perform some action.
CheckBox A box that the user can check and clear.
CheckedListBox A list of items with check boxes that the user can check and clear.
ColorDialog Lets the user pick a standard or custom color.
ComboBox A text box with an attached list or drop-down list that the user can use to enter or select a textual value.
ContextMenuStrip A menu that appears when the user right-clicks a control. You set a control’s ContextMenuStrip property to this control, and the rest is automatic.
Row 2
DataGridView A powerful grid control that lets you display large amounts of complex data with hierarchical or web-like relationships relatively easily.
DataSet An in-memory store of data with properties similar to those of a relational database. It holds objects representing tables containing rows and columns, and can represent many database concepts such as indexes and foreign key relationships.
DateTimePicker Lets the user select a date and time in one of several styles.
DirectoryEntry Represents a node in an Active Directory hierarchy.
DirectorySearcher Performs searches of an Active Directory hierarchy.
DomainUpDown Lets the user scroll through a list of choices by clicking up-arrow and down-arrow buttons.
ErrorProvider Displays an error indicator next to a control that is associated with an error.
EventLog Provides access to Windows event logs.
FileSystemWatcher Notifies the application of changes to a directory or file.
FlowLayoutPanel Displays the controls it contains in rows or columns.
Row 3
FolderBrowserDialog Lets the user select a folder.
FontDialog Lets the user specify a font’s characteristics (name, size, boldness, and so forth).
GroupBox Groups related controls for clarity. It also defines a default RadioButton group for any RadioButtons that it contains.
HelpProvider Displays help for controls that have help if the user sets focus on the control and presses F1.
HScrollBar A horizontal scroll bar.
ImageList Contains a series of images that other controls can use. For example, the images that a TabControl displays on its tabs are stored in an associated ImageList control. Your code can also pull images from an ImageList for its own use.
Label Displays read-only text that the user cannot modify or select by clicking and dragging.
LinkLabel Displays a label, parts of which may be hyperlinks. When the user clicks a hyperlink, the program can take some action.
ListBox Displays a list of items that the user can select. Depending on the control’s properties, the user can select one or several items at the same time.
ListView Displays a list of items in one of four possible views: LargeIcon, SmallIcon, List, and Details.
Row 4
MaskedTextBox A text box that requires the input to match a specific format (such as a phone number or ZIP code format).
MenuStrip Represents the form’s main menus, submenus, and menu items.
MessageQueue Provides communication between different applications.
MonthCalendar Displays a calendar that allows the user to select a range of dates.
NotifyIcon Displays an icon in the system tray or status area.
NumericUpDown Lets the user change a number by clicking up- and down-arrow buttons, or by pressing up-arrow and down-arrow keys.
OpenFileDialog Lets the user select a file for opening.
PageSetupDialog Lets the user specify properties for printed pages. For example, it lets the user specify the printer’s paper tray, page size, margins, and orientation (portrait or landscape).
Panel A control container. The control can automatically provide scroll bars and defines a RadioButton group for any RadioButtons that it contains.
PerformanceCounter Provides access to Windows performance counters.
Row 5
PictureBox Displays a picture.
PrintDialog Displays a standard print dialog box. The user can select the printer, pages to print, and printer settings.
PrintDocument Represents output to be sent to the printer. A program can use this object to print and display print previews.
PrintPreviewControl Displays a print preview within one of the application’s forms.
PrintPreviewDialog Displays a print preview in a standard dialog box.
Process Allows the program to interact with processes, including starting and stopping them.
ProgressBar Displays a series of colored bars to show the progress of a long operation.
PropertyGrid Displays information about an object in a format similar to the one used by the Properties window at design time.
RadioButton Represents one of an exclusive set of options. When the user selects a RadioButton, Visual Basic deselects all other RadioButton controls in the same group. Groups are defined by GroupBox and Panel controls and the Form class.
RichTextBox A text box that supports Rich Text extensions. The control can display different pieces of text with different font names, sizes, bolding, and so forth. It also provides paragraph-level formatting for justification, bullets, hanging indentation, and more.
Row 6
SaveFileDialog Lets the user select the name of a file where the program will save data.
SerialPort Represents a serial port and provides methods for controlling, reading from, and writing to it.
ServiceController Represents a Windows service and lets you manipulate services.
SplitContainer Lets the user drag a divider vertically or horizontally to split available space between two areas within the control.
Splitter Provides a divider that the user can drag to split available space between two controls. The Dock properties and stacking orders of the controls and the Splitter determine how the controls are arranged and resized. The SplitContainer control automatically provides a Splitter between two containers, so it is usually easier and less confusing to use.
StatusStrip Provides an area (usually at the bottom of the form) where the application can display status messages, small pictures, and other indicators of the application’s state.
TabControl Displays a series of tabs attached to pages that contain their own controls. The user clicks a tab to display the associated page.
TableLayoutPanel Displays the controls it contains in a grid.
TextBox Displays some text that the user can edit.
Timer Triggers an event periodically. The program can take action when the event occurs.
Row 7
ToolStrip Displays a series of buttons, drop-downs, and other tools that let the user control the application.
ToolStripContainer A container that allows a ToolStrip control to dock to some or all of its edges. You might dock a ToolStripContainer to a form to allow the user to dock a ToolStrip to each of the form’s edges.
ToolTip Displays a tooltip if the user hovers the mouse over an associated control.
TrackBar Allows the user to drag a pointer along a bar to select a numeric value.
TreeView Displays hierarchical data in a graphical, tree-like form.
VScrollBar A vertical scroll bar.
WebBrowser A web browser in a control. You can place this control on a form and use its methods to navigate to a web page. The control displays the results exactly as if the user were using a standalone browser. One handy use for this control is displaying web-based help.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.149.243.18