Chapter 2: Controls in General


Overview

A control is a programming object that has a graphical component. A control sits on a form and interacts with the user, providing information and possibly allowing the user to manipulate it. Text boxes, labels, buttons, scroll bars, drop-down lists, menu items, toolstrips, and just about everything else that you can see and interact with in a Windows application is a control.

A component is similar to a control, except it has no visible component at runtime. When you add a component to a form at design time, it appears in the component tray below the bottom of the form. You can select the component and use the Properties window to view and change its properties. At runtime, the component is invisible to the user, although it may display a visible object such as a menu, dialog box, or status icon.

Figure 2-1 shows the Visual Basic Toolbox displaying a standard assortment of 67 controls and components, plus the arrow tool in the upper-left corner. The arrow represents the selection tool and is not a control or component.

image from book
Figure 2-1: Visual Basic provides a rich assortment of controls.

Tip 

Note that you can also add other controls to the toolbox or remove existing controls. You can even create new toolbox tabs to hold assortments of your favorite controls.

This chapter explains controls and components in general terms. It describes different kinds of controls and components. It explains how your program can use them at design time and runtime to give the user information and to allow the user to control your application. It also explains in general terms how a control’s properties, methods, and events work, and it lists some of the most useful properties, methods, and events provided by the Control class. Other controls that are derived from this class inherit the use of those properties, methods, and events unless they are explicitly overridden.

Appendix G describes specific controls in greater detail.




Visual Basic 2005 with  .NET 3.0 Programmer's Reference
Visual Basic 2005 with .NET 3.0 Programmer's Reference
ISBN: 470137053
EAN: N/A
Year: 2007
Pages: 417

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net