This section covers all these ways of allowing dynamic sizing and positioning of controls.ĭocking refers to gluing a control to the edge of a parent control. Controls can also be dynamically arranged inside some special container controls intended for that purpose. Controls can be set to automatically stretch and reposition themselves as a form is resized.
Windows Forms 2.0 includes a variety of ways to allow user interfaces to be dynamic. (The term comes from the z-axis, which is an axis perpendicular to the traditional x- and y-axes.) The z-order can be changed by right-clicking the control and selecting Bring to Front.ĭynamic Sizing and Positioning of Controls The z-order is a ranking number that determines which controls are in front of or behind other controls. The control that is highest in the z-order receives the focus first. At runtime, Visual Basic will break the tie by using the z-order of the controls. In Windows Forms 2.0, it is possible to have two or more controls with the same tab index value. The screen shot in Figure 15-5 shows a simple form with the tab order feature enabled. To set the values, simply click on each control in the sequence you want the tab flow to operate. This will result in a small number in the upper-left corner of each control on your form, representing the tab index of that control. To activate the feature, open a form in the designer and select View Tab Order.
The VS2005 design environment enables you to set the tab order of the controls on a form simply by clicking them in sequence. Important changes from pre-.NET versions of Visual Basic (VB6 and earlier) are briefly mentioned. This section covers the features that all controls use (such as docking) and summarizes the standard controls available to you. The controls in Windows Forms 2.0 are very similar to those in previous versions of Windows Forms, but there are some significant differences to the controls in VB6. The controls included in Windows Forms provide basic functionality for a wide range of applications.