Adding Controls Using the Toolbox

5:22 AM / Posted by Alagan /

Things like buttons, textboxes, and labels are all things that you can add to your Forms. They are know as Controls, and are kept in the Toolbox for ease of use.
The Toolbox can be found on the left of the screen. In the picture below, you can see the toolbox icon next to Form1



To display all the tools, move your mouse over the toolbox icon. You'll see the following automatically appear:

There are five categories of tools available: Data, Components, Windows Forms, Clipboard Ring, and General. The toolbox you'll be working with is the Windows Forms toolbox. To see the tools, click on the words "Windows Forms". You'll see a long list of tools:


As you can see, there are an awful lot of tools to choose from! Click the black arrow, and scroll down to see even more. For this first section, we'll only be using the ones at the top: the Button, the TextBox and the Label.
If you want to keep the toolbox displayed, click the Pin icon next to the X. To close the toolbox, simply move your mouse away.
In the next part, we'll see how to add a textbox to the form.

Adding a Tool (Control) to your Form

Let's start by adding a textbox to our form. With the tools displayed, do the following:
•Locate the TextBox tool
•Double click the icon
•A textbox is added to your form
The textbox gets added to the top left position of your form. To move it down, hold your mouse over the textbox and drag to a new position


Notice the small squares around the textbox. These are sizing handles. Move your mouse over one of them. The mouse pointer turns into an extended line with arrowheads. Hold your left mouse button down and drag outwards. The textbox is resized. Play around with the sizing handles until you're happy with the size of your textbox.
One thing you will notice is that you can't make the size any higher, but you can make it wider. The reason why you can't make it any higher is because the default action of a textbox is to have it contain only a single line of text. If it's only going to contain one line of text, Microsoft reasoned, there's no reason why you should be able to change its height. A textbox can only be made higher if it's set to contain multiple lines of text. You'll see how to do this soon.
You should now have a textbox on your form that looks something like this one:

Labels:

0 comments:

Post a Comment