Define a tool bar
So if you haven't made use of your programs' toolbar options or customization features in the past, now is a good time to start! The definition of Toolbar on this page is an original TechTerms. If you would like to reference this page or cite this definition, you can use the green citation links above. The goal of TechTerms. We strive for simplicity and accuracy with every definition we publish.
If you have feedback about the Toolbar definition or would like to suggest a new technical term, please contact us. Want to learn more tech terms? Subscribe to the daily or weekly newsletter and get featured terms and quizzes delivered to your inbox.
You can unsubscribe or change your frequency setting at any time using the links available in each email. Please contact us. This browser is no longer supported.
Download Microsoft Edge More info. Contents Exit focus mode. Please rate your experience Yes No. Any additional feedback? Note The ToolStrip control replaces and adds functionality to the ToolBar control; however, the ToolBar control is retained for both backward compatibility and future use, if you choose. Submit and view feedback for This product This page. To specify or change the icon of a button, after clicking it, in the Properties window, click Image, then click its browse button.
To programmatically specify the icon of a button, you have many options. The ToolStripButton class is equipped with a property named Image. Assign an icon to this property. The ToolStripButton class provides another constructor whose syntax is:. When creating a button, you can use this constructor to directly specify its icon.
If an icon is not explicit enough, you can make it display text or a combination of an icon and text. To visually configure this behavior, access the Properties window for the button and, in the DisplayStyle field, select the desired member. To do this programmatically, access the DisplayStyle property and assign the desired value to it. To visually specify the text to display, type it in the Text property. To do it programmatically, you have various options.
You can assign a string to the Text property of the button. The ToolStripButton class is equipped with another constructor whose syntax is:. You can use this constructor to create a toolbar and specify its text. Of course, you must specify an appropriate value for the DisplayStyle property. To display both an icon and text, select the appropriate value of the DisplayStyle property. Then, in the Properties window of the button, specify the icon and enter the desired text.
Otherwise, the ToolStripButton class provides another constructor whose syntax is:. To use a button, the user can click it. Therefore, you should create an event handler for the button. You can use the Events section of the Properties window or programmatically write it. Otherwise, the ToolStripButton class supports all the normal events of a button. Instead of a classic button, you can create a type of menu on a toolbar so that, when the user clicks the button, a menu would come up.
To get it:. To programmatically create a drop down button, you can declare a variable of type ToolStripDropDownButton using its default constructor, allocate memory for it using the new operator, and add it to the Items collection of the ToolStrip variable. The primary characteristic of a drop down button is that it is equipped with a menu. To visually create the menu, after adding the button, it displays a text box labeled Type Here. Alternatively, click the drop down button on the toolbar.
You programmatically create the menu items of a drop down button like those of regular menu items. After creating them, add them to the DropDownItems collection of the drop down button. The menu items of a drop down button behave like the menu items we saw in Lessons Based on this, you can configure the items of the button the same way we reviewed for menu items. A separator is a vertical bar that is used to create sections or groups of items on a toolbar.
There is no strict rule as to where to put a separator. Only your experience and needs will guide you. Practical Learning: Adding Buttons to a Toolbar. When the user clicks a drop down button, its menu automatically displays. As an alternative, you can create a button split by a bar, showing a normal button on the left and a menu on the right. To support this, the. This class is represented by a control named split button. To visually add a split button to a toolbar, do one of the following:.
To programmatically create a split button, declare a variable of type ToolStripSplitButton and add it to the Items property of the toolbar. There are two ways a user can use a split button, by clicking the button itself on the left or the arrow on the right.
When the arrow button is clicked, a menu displays. The menu items that display are of type ToolStripItem. This means that you create them using the same descriptions we saw for menus. You can create a section on a toolbar to display text. As its name indicates, a label is meant to display text. After adding it to a toolbar, assign a string to its Text property. Instead of simple text, you can make a label behave like a link.
If you set this property to true, the label would follow the standard description of a web link without the link itself; you must find a way to make it active the desired link. You can add a text box to a toolbar so the user can type something in it or read text from it.
To make this possible, you can use a class named ToolStripTextBox. To add a text box to a toolbar:. To programmatically add a textbox to a toolbar, declare a variable of type ToolStripTextBox. The ToolStripTextBox class is equipped with 3 constructors. The default constructor is used to create a normal and simple text box. After declaring and initializing the variable, add it to the Items property of the toolstrip.
0コメント