Introduction to Global Items

Instead of global items we now recommend using new Commands feature in DotNetBar.

Certain properties on DotNetBar items are replicated to all the items with the same name or with the same GlobalName. This concept in DotNetBar is called Global Items. For instance, setting the Enabled property on Global Item will be replicated through all the items DotNetBarManager is aware of that have the either the same name or the same GlobalName.

This is very useful for example if you have same item on the menu and toolbar. This way you only have to set the property on one item and that setting will be replicated through all the items with the same name or GlobalName.

This is also important if you decide to allow your end-users to create or customize the toolbars. Since you do not know how many toolbars with the same items will be created by the users extensive coding would be needed to synchronize all items if Global Items behavior was not present.

The GlobalItem property which is by default set to true controls whether new property value is replicated to all items with the same Name or GlobalName. If you are creating the items through DotNetBar designer then VS.NET Windows Forms framework requires that all objects on the form have unique names. In that case set the GlobalName property to the desired item identifier. The GlobalName should be the same identifier for all items that perform same function so the Global Items feature in DotNetBar can find them.

If you do not wish to replicate the property value to all items with the same name, simply set the GlobalItem to false, change your property value and set the GlobalItem back to true.

List of replicated properties:

  • BaseItem.Enabled
  • BaseItem.BeginGroup
  • BaseItem.Visible
  • BaseItem.AutoExpand
  • BaseItem.Description
  • BaseItem.Stretch
  • BaseItem.Tooltip
  • BaseItem.Text
  • PopupItem.PopupType
  • PopupItem.PopupWidth
  • ButtonItem.ImagePosition
  • ButtonItem.ButtonStyle
  • ButtonItem.ImageIndex
  • ButtonItem.HoverImageIndex
  • ButtonItem.PressedImageIndex
  • ButtonItem.DisabledImageIndex
  • ButtonItem.ForeColor
  • ButtonItem.HotFontUnderline
  • ButtonItem.HotFontBold
  • ButtonItem.MenuVisibility
  • ButtonItem.RecentlyUsed
  • ButtonItem.HotTrackingStyle
  • ComboBoxItem.ComboWidth
  • TextBoxItem.TextBoxWidth
  • TextBoxItem.TextBoxWidth
  • DockContainerItem.ImageIndex
  • SideBarPanelItem.BackColor
  • SideBarPanelItem.HotFontBold
  • SideBarPanelItem.HotFontUnderline
  • SideBarPanelItem.HotForeColor
  • SideBarPanelItem.ForeColor