Placing Controls on Form
1. First way is, if you double-click a control on the Toolbox, Visual Studio places an instance of the control on the form in a default location and at a default size.
Then you can use the mouse to relocate and resize the control.
2. Second way is, if you click a control in the Toolbox, the mouse cursor changes while the mouse is over the form. The new cursor looks like a plus sign with a small image of the control's Toolbox icon next to it. If you click the form, Visual Studio adds a control at that location with a default size.
Figure 1 (with selected control in the toolbox you click the form)
Figure 2 (Visual Studio adds a control at the location you've clicked)
3. Third way is, if you do add and configure control programmatically at run time:
2. Second way is, if you click a control in the Toolbox, the mouse cursor changes while the mouse is over the form. The new cursor looks like a plus sign with a small image of the control's Toolbox icon next to it. If you click the form, Visual Studio adds a control at that location with a default size.
Figure 1 (with selected control in the toolbox you click the form)
Figure 2 (Visual Studio adds a control at the location you've clicked)
3. Third way is, if you do add and configure control programmatically at run time:
1
2
3
4
5
6
7
8
9
| Dim CheckBox1 As New CheckBox Me .CheckBox1.AutoSize = True Me .CheckBox1.Location = New System.Drawing.Point(31, 144) Me .CheckBox1.Name = "CheckBox1" Me .CheckBox1.Size = New System.Drawing.Size(94, 17) Me .CheckBox1.TabIndex = 4 Me .CheckBox1.Text = "Remember me" Me .CheckBox1.UseVisualStyleBackColor = True Me .Controls.Add(CheckBox1) |