ToolStrip control provides functionality of Windows toolbar controls in Visual Studio 2010. ToolStrip class represents a ToolStrip control in Windows Forms and serves as a base class of MenuStrip, StatusStrip, and ContextMenuStrip classes.
In this article, I will discuss how to create and use a ToolStrip control and use its properties and methods.
We can create a ToolStrip control at design-time using Visual Studio designer or using the ToolStrip class at run-time.
In this article, I will discuss how to create and use a ToolStrip control and use its properties and methods.
We can create a ToolStrip control at design-time using Visual Studio designer or using the ToolStrip class at run-time.
Using Designer
To create a ToolStrip control at design-time, simply drag and drop a ToolStrip control from Toolbox onto a Form. By default, a ToolStrip control is docked at the top of the Form. We can change docking and other properties using the Tasks control as shown in Figure 1.
To create a ToolStrip control at design-time, simply drag and drop a ToolStrip control from Toolbox onto a Form. By default, a ToolStrip control is docked at the top of the Form. We can change docking and other properties using the Tasks control as shown in Figure 1.

Figure 1
The next step is to set ToolStrip control properties. We can set properties by calling Properties window by using Right click on the control and selecting Properties menu item or simply hitting F4. Figure 2 shows Properties window where I set BackColor to green and GripStyle to Visible.

Figure 2
A ToolStrip control is nothing but a container without adding its child controls. A ToolStrip control is capable of hosting Button, Label, SplitButton, DropDownButton, Separator, ComboBox, TextBox and ProgressBar controls.
Now let's add a few controls to ToolStrip control.
If you click on a little dropdown handle on a ToolStrip control in designer, you will see a list of possible controls (See Figure 3) that can be added to a ToolStrip. To add a control, simply select that control and it will be added to the ToolStrip control.

Figure 3
Another way to add controls to a ToolStrip control is by using the Items property.
Click on the Items property and you will see Item Collection Editor that looks like Figure 4. We are going to add a Button, a TextBox, and a Label control to ToolStrip with a few separators.








Rushi MehtaPosted Sep 10, 2018, 7:00 AM
Thanks Mahesh, Nice Explanation given in this article, it will very helpful
digambar kashidPosted Oct 17, 2010, 2:45 PM
hi sir, sir i want to do sharepoint pls give initial requirement to do it.
digambar kashidPosted Oct 17, 2010, 2:45 PM
hi sir, sir i want to do sharepoint pls give initial requirement to do it.