Changes

Jump to: navigation, search

Designing Forms in Visual Studio

1,864 bytes added, 14:46, 20 July 2007
Visual Basic Forms and Controls
[[Image:visual_studio_toolbox.jpg| Visual Studio Toolbox]]
 
Visual Studio provide three methods for added new controls to a form. In this chapter we will cover each of these different approaches.
 
== Double Clicking the Control in the Toolbox ==
 
The Toolbox contains all of the controls available to be added to a form. One way to add a control to form is to simply double click on the control in the Toolbox. The control is then automatically added to the current form. The advantage of this approach is that it is very quick to add multiple controls to a form. The downside is that Visual Studio does not know where you want the control positioned in the form and consequently positions the controls near to the top left hand corner of the form. Once the control is added to the form you will need to click drag it to the desired location.
 
== Dragging a Dropping Controls onto the Form ==
 
Another approach to adding controls to a form is to click on the control in the Toolbox and drag it onto the form. When the control is in the required location release the mouse button to drop the control into place. The position of the control can subsequently be refined using the mouse or arrow keys to move the location of the control.
 
== Drawing a Control on the Form ==
 
The most precise mechanism for adding a control to a form is to draw it. This is achieved by first selecting the desired control in the Toolbox. Once the control is highlighted, move the mouse pointer to the location on the form where you would like the top left hand corner of the new control to appear. Click and hold down the left hand mouse button a drag the pointer. A box will be drawn as you drag the pointer. When the box reaches the required size for the new control, release the mouse button. The new control will appear position and sized according to the size and location of the box.
 
== Positioning and Sizing Controls Using the Grid ==

Navigation menu