From VB.NET Developer's Guide
Adding Controls to Forms
Most forms contain controls that display information to the user or collect information from the user. These controls are most often added to the form at design time. You can add a control to a form at design time in several ways:
- From the View menu, select Toolbox.
- On the Toolbox window, select the Win Forms tab.
- Double-click the appropriate control.
Or:
- Click the appropriate control.
- On the form, click or drag the mouse.
You can arrange controls on forms in many ways. You can anchor, dock, layer, and position controls on forms. In the following sections, we discuss these different ways to arrange controls on forms.
Anchoring Controls on Forms
The controls on a resizable form should resize and reposition properly when the user resizes the form. In previous versions of Visual Basic, this required extensive coding or a custom component to carry out control resizing and repositioning. In Visual Basic .NET, you can use the Anchor property of Windows Forms controls. The Anchor property determines to which edges of the container a control is bound. When a control is anchored to an edge, the distance between the control s closest edge and the specified edge will remain constant. Say for example that you have a combo box that is anchored to the top, left, and right edges of a form (see Figure 7.2).
Figure 7.2: A Combo Box Anchored to the Top, Left, and Right Edges of a...
Products & Services
Topics of Interest
Dialog Boxes Dialog boxes display information to the user and collect information from the user. They are useful because they present visual cues that are familiar to the Windows user. Technically,...
Creating and Working with Menus Menus hold commands grouped by a common topic. Menus make it easy for your users to navigate your application as they see menus they have already used in Windows,...
Introduction The .NET Framework provides a common object-based framework for creating forms. All programming languages will use the same forms which are called Windows Forms. This gives C++ users...
Data Binding We have now discussed many ways of displaying information to the user and collecting information from the user. In most applications, the information displayed comes from a data source...
We all know there is no reason to keep reinventing the wheel. Using existing resources speeds the development process and can result in a more bug-free application. Using ActiveX Controls...