BarItem Class

Represents an individual item that can be displayed in a menu structure, a tool bar or a popup menu in the XP Menus framework.
Object Model
BarItem ClassImageExt ClassImageListAdv ClassImageListAdv ClassImageExt ClassImageListAdv ClassImageListAdv ClassImageExt ClassImageListAdv ClassImageListAdv ClassImageListAdv ClassImageListAdv Class
<DesignerAttribute(Syncfusion.Windows.Forms.Tools.Design.BarItemDesigner, System.ComponentModel.Design.IDesigner)>
Public Class BarItem 
   Inherits System.ComponentModel.Component
   Implements Syncfusion.ComponentModel.IChangeNotifyingItem, Syncfusion.Windows.Forms.IDataBindingSupport 
Dim instance As BarItem
[Designer(Syncfusion.Windows.Forms.Tools.Design.BarItemDesigner, System.ComponentModel.Design.IDesigner)]
public class BarItem : System.ComponentModel.Component, Syncfusion.ComponentModel.IChangeNotifyingItem, Syncfusion.Windows.Forms.IDataBindingSupport  

In order for the BarItem to be displayed, you must add it to the Items property of a ParentBarItem (to appear in menus or context menus) or a Bar (to appear in the tool bar). This is normally achieved using simple drag-and-drop during design-time. The BarItem will of course be rendered differently based on whether it is part of a menu structure or the tool bar.

The BarItem class provides properties that enable you to configure the appearance and functionality of a bar item. To display a check mark next to this bar item (when in a menu) or to give it a special checked highlight (when in a tool bar), use the Checked property. You can use this feature to identify a bar item that is selected in a list of mutually exclusive bar items. For example, if you have a set of bar items for setting the color of text in a TextBox control, you can use the Checked property to identify which color is currently selected.

The Shortcut property can be used to define a keyboard combination that can be pressed to select the bar item.

You can enable partial menus behavior in bar items when they are contained within a ParentBarItem by setting the BarItem's IsRecentlyUsedItem property.

In an MDI scenario, bar items added to an MDI parent's MainMenu(BarStyle.IsMainMenu enabled in the Bar.BarStyle property) and the MDI child's MainMenu will automatically be merged to create a consolidated menu structure.

Take a look at our XPMenus samples under the Tools\Samples\Menus Package folder for usage example.
Inheritance Hierarchy



Syncfusion.Tools.Windows: 18.1460.0.42

See Also