How to Add Controls to the Application in MS Visual Studio 2005
Video Transcript
Next, we will review some of the new Windows Forms 2.0 controls such as the Tool Strip, Menu Strip, Status Strip and web browser control. Let us go ahead and examine this.
On the left hand side inside your toolbox, go ahead and collapse the to Windows Forms node. Scroll down to the menus and Toolbars. We will start by working with the Menu Strip control. Go ahead and drag that over unto your form. The Menu Strip presents two design interfaces. You can see one in place on the form to the goes that text box that reads type here. Another interface is to the Menu Strip items collection editor. You can get to this editor in two ways. One way is through the properties window in items. You scroll down to your properties items.
Another interface is provided through the Menu Strip's smart tag menu. Let us go ahead and examine that. You click on the smart tag. You can also edit items from here. Click on edit items. This brings up the items collection editor. The items collection editor allows you to manage the items on the Menu Strip control. If you look at the items that are available, you can see that the Menu Strip supports menu item, combo box and text box controls. We are not going to add any items now so click the cancel button. Let us go to our design interface.
As you can see, if I click on the menu item, I can start adding menu items. Once I start adding new menu items, new text box controls appear. There is one directly to the right of the first control and another below. You can add files to menu items by typing into the lower text box. A second top level menu maybe added by typing into the top text box. As menus are created by typing into the text box controls, new controls appear making it very easy to build quickly a series of nested menus. Right click on the file item that we just created in the previous step and select delete. Do the same thing with the edit.
There is yet another way of adding menu items. Going to move to the right hand side of your screen and select the Smart Task. Here, you will see an option for inserts standard items. Go ahead and click on that to see what happens. If you look, menu items are automatically added for you. Not only is the text added for you but also icons and shortcut keys are also added for you. You can continue to edit as you did before, but at least now, you have a basic set of Windows XP style menus.
The next thing we will do is adjust the properties of our Menu Strip. Go ahead and move to your properties window. Make sure that the Menu Strip is selected. And now, we are going to have to change the group style property from being hidden to visible. If you look carefully on the left hand part of my menu, I see these three little dots. This dotted group is used to reposition the control at run time. Now that we have our Menu Strip control, let us keep building. Let us move on to the Tool Strip control.
Let us take the Tool Strip control and drag that right below our Menu Strip. The Tool Strip is a very powerful and very customizable control for building highly functional and professional looking Toolbars. Just like the Menu Strip control, it has two interfaces for designing Toolbars and in place interactive interface as you see here and the items collection editor for Tool Strips. Let us insert some standard items here as well. Scroll over, select the Smart Task for the Tool Strip and select insert standard items. If you take a look, you have Microsoft office style icons now added to your Toolbar. Again, this functionality does you great productivity as you no longer have to build this by hand. Now, let us go ahead and adjust some properties for our Tool Strip.
Select the Tool Strip and go to your properties window. Navigate to allow item reorder property. Change the allow item reorder property to be true. Setting allow item reorder to true makes the possible to change the order of items on a Toolbar and even move items across Toolbars by Alt clicking and dragging the Tool Strip items. You saw me do this earlier with the finished product. Let us go ahead and set a couple more proper
Next, we will review some of the new Windows Forms 2.0 controls such as the Tool Strip, Menu Strip, Status Strip and web browser control. Let us go ahead and examine this.
On the left hand side inside your toolbox, go ahead and collapse the to Windows Forms node. Scroll down...
click to read more