Item Types of CommandBar for WinForms C# Tutorial
The WinForms CommandBar control is a powerful and easy to use user interface control for Windows Forms. This CommandBar control provides large flexibility for developers to customize it. The item is one of the elements on the fifth level in the structure of the CommandBar Control for Windows Forms. There are various item types available for developers to add the item types to the CommandBarStripElement from the context menu or the Element Collection Editor. The following are the Item Types and their detailed descriptions
Item Types of CommandBar Control
- CommandBarButton , this item is used to display a button with text and/or an image. The text of a button can be displayed by enable the DrawText property. The layout of image and text are determined by the TextImageRelation property. The valid values contain Overlay, ImageAboveText, TextAboveImage, ImageBeforeText, and TextBeforeImage.
- CommandBarToggleButton , this item is used to display a button with toggle between the states of pressed and unpressed. The button element of Toggle State property shows the current condition of the button.
- CommandBarTextBox , this item is used to display a text box that is used to hold the input from users and the Text property is able to configure the content.
- CommandBarDropDownList , this item is used to display a dropdown list. The SelectedIndexChanged and SelectedValueChanged events are used to respond to user selections.
- CommandBarLabel , this item is used to display static text on a strip element, whose content can be changed by the Text property.
- CommandBarSeparatorItem , this item is used to add empty space between other elements on a strip element.
- CommandBarDropDownButton , this item is used to display a button with a drop-down arrow. From the drop-down arrow, a menu of users' selection can be displayed.
- CommandBarSplitButton , this item is used to display a button with a drop-down arrow. Clicking the drop-down arrow displays a menu of choices. Clicking the button has the same effect as clicking the default item from the menu.
- CommandBarHostItem , this is the item that can host any Element. The HostedElement property is used to customize the hosted element