WinForms

Upgrade Guide User Guide Demos Support Forums Download
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class ListBarItem - WindowsForms API Reference | Syncfusion BarItem derived class that expands into a list when shown. ">

    Show / Hide Table of Contents

    Class ListBarItem

    A BarItem derived class that expands into a list when shown.

    Inheritance
    System.Object
    BarItem
    BarItemEx
    ListBarItem
    MdiListBarItem
    Implements
    IChangeNotifyingItem
    System.ComponentModel.ICustomTypeDescriptor
    IDataBindingSupport
    System.Runtime.Serialization.ISerializable
    System.ICloneable
    Inherited Members
    BarItemEx.HandleDoubleClick
    BarItem.Dispose(Boolean)
    BarItem.GetState(Int32)
    BarItem.SetState(Int32, Boolean)
    BarItem.ShouldSerializePadding()
    BarItem.ShouldSerializeCustomNormalTextColor()
    BarItem.ResetCustomNormalTextColor()
    BarItem.ShouldSerializeCustomDisabledTextColor()
    BarItem.ResetCustomDisabledTextColor()
    BarItem.ShouldSerializeCustomActiveTextColor()
    BarItem.ResetCustomActiveTextColor()
    BarItem.ShouldSerializeImageList()
    BarItem.ResetImageList()
    BarItem.ShouldSerializeImageListAdv()
    BarItem.ResetImageListAdv()
    BarItem.ShouldSerializeLargeImageList()
    BarItem.ResetLargeImageList()
    BarItem.ShouldSerializeLargeImageListAdv()
    BarItem.ResetLargeImageListAdv()
    BarItem.ShouldSerializeDisabledImageList()
    BarItem.ResetDisabledImageList()
    BarItem.ShouldSerializeDisabledLargeImageList()
    BarItem.ResetDisabledLargeImageList()
    BarItem.ShouldSerializeHighlightImageList()
    BarItem.ResetHighlightImageList()
    BarItem.ShouldSerializeHighlightImageListAdv()
    BarItem.ResetHighlightImageListAdv()
    BarItem.ShouldSerializeHighlightLargeImageList()
    BarItem.ResetHighlightLargeImageList()
    BarItem.ShouldSerializeHighlightLargeImageListAdv()
    BarItem.ResetHighlightLargeImageListAdv()
    BarItem.ShouldSerializePressedImageList()
    BarItem.ResetPressedImageList()
    BarItem.ShouldSerializePressedImageListAdv()
    BarItem.ResetPressedImageListAdv()
    BarItem.ShouldSerializePressedLargeImageList()
    BarItem.ResetPressedLargeImageList()
    BarItem.ShouldSerializePressedLargeImageListAdv()
    BarItem.ResetPressedLargeImageListAdv()
    BarItem.IsValidHighlightedImageIndex(Boolean)
    BarItem.IsValidPressedImageIndex(Boolean)
    BarItem.ResetShortcutText()
    BarItem.ShouldSerializeShortcutText()
    BarItem.ShouldSerializeImageTransparentColor()
    BarItem.ResetImageTransparentColor()
    BarItem.ResetImageSize()
    BarItem.ShouldSerializeImageSize()
    BarItem.PerformUpdateUI()
    BarItem.PerformDoubleClick()
    BarItem.PerformClick()
    BarItem.PerformSelected()
    BarItem.PerformUnselected()
    BarItem.OnAfterPopupItemPaint(PopupItemPaintEventArgs)
    BarItem.OnBeforePopupItemPaint(PopupItemPaintEventArgs)
    BarItem.OnDrawToolbarItem(DrawToolbarItemEventArgs)
    BarItem.OnPropertyChanged(SyncfusionPropertyChangedEventArgs)
    BarItem.OnCanDragDrop(CanDragDropEventArgs)
    BarItem.OnUpdateUI(EventArgs)
    BarItem.OnProvideFontInfo(ProvideFontInfoEventArgs)
    BarItem.OnContainmentChanged(ContainmentChangedEventArgs)
    BarItem.OnItemClicked(EventArgs)
    BarItem.OnItemMouseDown(MouseEventArgs)
    BarItem.OnItemMouseUp(MouseEventArgs)
    BarItem.OnSelected(EventArgs)
    BarItem.OnUnselected(EventArgs)
    BarItem.OnShowTooltipChanged()
    BarItem.OnItemDoubleClicked(EventArgs)
    BarItem.GetPropertiesToDisableInDesignTime()
    BarItem.ReiseBeforePopupItemPaint(Graphics, Rectangle, Boolean, DrawElement, GridStyleInfo)
    BarItem.ReiseAfterPopupItemPaint(Graphics, Rectangle, Boolean, DrawElement, GridStyleInfo)
    BarItem.IsDisposing
    BarItem.IsDisposed
    BarItem.Designer
    BarItem.PaddingForThemesX
    BarItem.ShowToolTipInPopUp
    BarItem.PaddingForThemesY
    BarItem.Padding
    BarItem.TextAlignment
    BarItem.CustomNormalTextColor
    BarItem.CustomDisabledTextColor
    BarItem.CustomActiveTextColor
    BarItem.CustomTextFont
    BarItem.ResizeGlyphToFit
    BarItem.ShowMnemonicUnderlinesAlways
    BarItem.MergeType
    BarItem.Customizable
    BarItem.MergeOrder
    BarItem.PaintStyle
    BarItem.Enabled
    BarItem.Checked
    BarItem.ImageIndex
    BarItem.ImageList
    BarItem.ImageListAdv
    BarItem.LargeImageList
    BarItem.LargeImageListAdv
    BarItem.DisabledImageList
    BarItem.DisabledImageListAdv
    BarItem.DisabledLargeImageList
    BarItem.DisabledLargeImageListAdv
    BarItem.HighlightImageList
    BarItem.HighlightImageListAdv
    BarItem.HighlightLargeImageList
    BarItem.HighlightLargeImageListAdv
    BarItem.PressedImageList
    BarItem.PressedImageListAdv
    BarItem.PressedLargeImageList
    BarItem.PressedLargeImageListAdv
    BarItem.IsValidDisabledImageIndex
    BarItem.HighlightedImageIndex
    BarItem.PressedImageIndex
    BarItem.DisabledImageIndex
    BarItem.Visible
    BarItem.Tag
    BarItem.Text
    BarItem.BarName
    BarItem.ID
    BarItem.Tooltip
    BarItem.CategoryIndex
    BarItem.Shortcut
    BarItem.ShortcutText
    BarItem.Manager
    BarItem.MetroBackColor
    BarItem.IsRecentlyUsedItem
    BarItem.UpdateUIOnAppIdle
    BarItem.UpdateUIRequired
    BarItem.DrawImageMirrored
    BarItem.SizeToFit
    BarItem.TopLevelForm
    BarItem.ShowTooltip
    BarItem.Image
    BarItem.ImageTransparentColor
    BarItem.DisabledImage
    BarItem.HighlightedImage
    BarItem.ImageSize
    BarItem.DesignMode
    BarItem.DataBindings
    BarItem.IDataBindingSupport.PropertyNamePrefix
    BarItem.Click
    BarItem.Selected
    BarItem.Unselected
    BarItem.MouseDown
    BarItem.MouseUp
    BarItem.PropertyChanged
    BarItem.DrawToolbarItem
    BarItem.ContainmentChanged
    BarItem.CanDragDrop
    BarItem.UpdateUI
    BarItem.ProvideFontInfo
    BarItem.AfterPopupItemPaint
    BarItem.BeforePopupItemPaint
    BarItem.ShowTooltipChanged
    BarItem.DoubleClick
    Namespace: Syncfusion.Windows.Forms.Tools.XPMenus
    Assembly: Syncfusion.Tools.Windows.dll
    Syntax
    public class ListBarItem : BarItemEx, IChangeNotifyingItem, ICustomTypeDescriptor, IDataBindingSupport, ISerializable, ICloneable
    Remarks

    Use this class when you have to represent a dynamic list of BarItems. When shown this bar item will be replaced by a numbered list of BarItems based on the supplied ChildCaptions list and when one of the items gets clicked by the user a Click event is thrown by this instance with the ListBarItemClickedEventArgs args.

    This also means you should not use a ListBarItem in a tool bar. If you do so, you might see unpredictable behavior. The user will automatically be prevented from dropping a ListBarItem into a tool bar during customization.

    Note that the Click event handler will be called with a ListBarItemClickedEventArgs argument containing data pertaining to the child item that was clicked. Which means you should cast the regular EventArgs argument into this type in your handler.

    A typical example is the Most Recently Used Files list. The framework also internally uses this to represent the MDI Child list(MdiListBarItem).

    Examples

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

    Constructors

    ListBarItem()

    Creates an instance of the ListBarItem class.

    Declaration
    public ListBarItem()

    ListBarItem(SerializationInfo, StreamingContext)

    Declaration
    protected ListBarItem(SerializationInfo info, StreamingContext context)
    Parameters
    Type Name Description
    System.Runtime.Serialization.SerializationInfo info
    System.Runtime.Serialization.StreamingContext context

    Properties

    CheckedIndices

    Returns the items in the ChildCaptions list that should be marked as checked.

    Declaration
    public virtual IntList CheckedIndices { get; }
    Property Value
    Type Description
    IntList

    A list of indices into the ChildCaptions list.

    Remarks

    This list will be used to determine the checked state of the expanded BarItems.

    ChildCaptions

    Returns the captions for the expanded bar items.

    Declaration
    public virtual StringCollection ChildCaptions { get; }
    Property Value
    Type Description
    System.Collections.Specialized.StringCollection

    Represents the StringCollection that will hold the list of captions.

    ExpandedBarItems

    Returns a list of expanded BarItems.

    Declaration
    public ArrayList ExpandedBarItems { get; }
    Property Value
    Type Description
    System.Collections.ArrayList

    An ArrayList if the expanded BarItems are currently shown. Null (or Nothing) otherwise.

    Remarks

    This property will return a non-null value only when queried from the AfterExpand event handler. It's recommended that you do not hold any references to the BarItems returned by this property.

    Tags

    Returns the list of application specific values corresponding to the ChildCaptions entries.

    Declaration
    public virtual ArrayList Tags { get; }
    Property Value
    Type Description
    System.Collections.ArrayList

    The list that contains the application specific values.

    UseNumberedList

    Indicates whether to use numbers in the expanded list.

    Declaration
    public bool UseNumberedList { get; set; }
    Property Value
    Type Description
    System.Boolean

    True to include numbers; false otherwise.

    Methods

    AddCheckIndices(Int32)

    Declaration
    public void AddCheckIndices(int str)
    Parameters
    Type Name Description
    System.Int32 str

    AddChildCaptions(String)

    Declaration
    public void AddChildCaptions(string str)
    Parameters
    Type Name Description
    System.String str

    Clone()

    Creates a clone of this ListBarItem instance.

    Declaration
    public override object Clone()
    Returns
    Type Description
    System.Object

    An object that has similar properties to this ListBarItem.

    Overrides
    BarItem.Clone()
    Remarks

    Creates a new instance of ListBarItem and calls the CopyTo(BarItem) method to copy over properties.

    CopyTo(BarItem)

    Copies the properties of this ListBarItem into the specified ListBarItem.

    Declaration
    public override void CopyTo(BarItem barItem)
    Parameters
    Type Name Description
    BarItem barItem

    The ListBarItem where the values should be copied to.

    Overrides
    BarItem.CopyTo(BarItem)
    Remarks

    The tags will be copied over only if the actual objects are cloneable (implements IClonable).

    GetObjectData(SerializationInfo, StreamingContext)

    Declaration
    public override void GetObjectData(SerializationInfo info, StreamingContext context)
    Parameters
    Type Name Description
    System.Runtime.Serialization.SerializationInfo info
    System.Runtime.Serialization.StreamingContext context
    Overrides
    BarItem.GetObjectData(SerializationInfo, StreamingContext)

    InsertChildCaptions(Int32, String)

    Declaration
    public void InsertChildCaptions(int index, string str)
    Parameters
    Type Name Description
    System.Int32 index
    System.String str

    ItemClicked(Int32, BarItem)

    Declaration
    protected virtual void ItemClicked(int index, BarItem item)
    Parameters
    Type Name Description
    System.Int32 index
    BarItem item

    OnAfterExpand(EventArgs)

    Raises the AfterExpand event.

    Declaration
    protected virtual void OnAfterExpand(EventArgs e)
    Parameters
    Type Name Description
    System.EventArgs e

    OnBeforeExpand()

    Called before the item gets expanded by its parent.

    Declaration
    protected virtual void OnBeforeExpand()
    Remarks

    This is a good place to fill the ChildCaptions list with appropriate values.

    PopupClosed()

    Declaration
    protected virtual void PopupClosed()

    PostExpand(ParentBarItem, Int32, Int32)

    Called after this item's parent expands this item.

    Declaration
    protected virtual void PostExpand(ParentBarItem parent, int firstChildIndex, int lastChildIndex)
    Parameters
    Type Name Description
    ParentBarItem parent

    The parent where this item is hosted.

    System.Int32 firstChildIndex

    The index into the parent representing the BarItem corresponding to the first item in the ChildCaptions list.

    System.Int32 lastChildIndex

    The index into the parent representing the BarItem corresponding to the last item in the ChildCaptions list.

    Remarks

    With the reference to the parent, you can insert items if necessary before the parent gets shown.

    RemoveChildCaptions(Int32)

    Declaration
    public void RemoveChildCaptions(int str)
    Parameters
    Type Name Description
    System.Int32 str

    RemoveChildCaptions(String)

    Declaration
    public void RemoveChildCaptions(string str)
    Parameters
    Type Name Description
    System.String str

    UpdateCheckedStates()

    Updates the checked state of the expanded list BarItems. This method is usable only when the ListBarItem is being shown in a submenu.

    Declaration
    public virtual void UpdateCheckedStates()

    Events

    AfterExpand

    Occurs after the expansion of the Captions into BarItems.

    Declaration
    public event EventHandler AfterExpand
    Event Type
    Type Description
    System.EventHandler
    Remarks

    The handler for this event is a good place to access the expanded BarItems and set some properties on it. Note that these expanded items will be disposed when the parent menu is hidden.

    BeforeExpand

    Occurs before the expansion of the Captions into BarItems. This is a good place to delay-insert Captions into the ChildCaptions list.

    Declaration
    public event EventHandler BeforeExpand
    Event Type
    Type Description
    System.EventHandler

    Explicit Interface Implementations

    ICloneable.Clone()

    Declaration
    object ICloneable.Clone()
    Returns
    Type Description
    System.Object

    Implements

    IChangeNotifyingItem
    System.ComponentModel.ICustomTypeDescriptor
    IDataBindingSupport
    System.Runtime.Serialization.ISerializable
    System.ICloneable
    Back to top Generated by DocFX
    Copyright © 2001 - 2021 Syncfusion Inc. All Rights Reserved