menu

WinForms

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class ToolStripEx - WindowsForms API Reference | Syncfusion

    Show / Hide Table of Contents

    Class ToolStripEx

    Inheritance
    System.Object
    ToolStripEx
    Implements
    IThemeProvider
    IVisualStyle
    IToolStripExSupport2
    IToolStripExSupport
    INativeMessageFilter
    Namespace: Syncfusion.Windows.Forms.Tools
    Assembly: Syncfusion.Tools.Windows.dll
    Syntax
    public class ToolStripEx : ToolStrip, IThemeProvider, IVisualStyle, IToolStripExSupport2, IToolStripExSupport, INativeMessageFilter

    Constructors

    ToolStripEx()

    Declaration
    public ToolStripEx()

    ToolStripEx(ToolStripRenderer)

    Declaration
    public ToolStripEx(ToolStripRenderer renderer)
    Parameters
    Type Name Description
    System.Windows.Forms.ToolStripRenderer renderer

    Fields

    DEF_IMAGE_BORDER_OFFSET

    Declaration
    protected const int DEF_IMAGE_BORDER_OFFSET = 5
    Field Value
    Type
    System.Int32

    DEF_PIXELS_BETWEEN_ELEMENTS_COLLAPSED

    Height of space between image and text and between text and down arrow in collapsed state dropdown button.

    Declaration
    protected const int DEF_PIXELS_BETWEEN_ELEMENTS_COLLAPSED = 2
    Field Value
    Type
    System.Int32

    Properties

    AllowMenuTextAlignment

    Gets or sets the value indicating whether to apply text alignment for the ToolStripMenuItems in the ToolStripEx.

    Declaration
    public bool AllowMenuTextAlignment { get; set; }
    Property Value
    Type
    System.Boolean
    Remarks

    Enabling this property will allow the text of ToolStripMenuItem to be aligned using its TextAlign property. Otherwise, by default it will be aligned to the left.

    BorderStyle

    Gets or sets the border style for the control.

    Declaration
    public virtual ToolStripBorderStyle BorderStyle { get; set; }
    Property Value
    Type
    ToolStripBorderStyle

    BorderWidth

    Gets the width of border.

    Declaration
    protected int BorderWidth { get; }
    Property Value
    Type
    System.Int32

    CanApplyTheme

    Gets or sets a value indicating whether a SkinManager theme style has been applied to the control.

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

    The default value is true.

    CanOverrideStyle

    Gets or sets a value indicating whether control elements styles can be overridden by theme style settings.

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

    Default value is false.

    Remarks

    By default, the control's element styles will not be overridden by theme style settings if the style is set in sample level. If this property is enabled, element style will be overridden by theme style settings event if it is set in sample level. This property should be enabled or disabled before calling the ThemeName property of the control.

    CaptionAlignment

    Gets or sets the alignment of caption.

    Declaration
    public virtual CaptionAlignment CaptionAlignment { get; set; }
    Property Value
    Type
    CaptionAlignment

    CaptionFont

    Gets or sets the caption font.

    Declaration
    public virtual Font CaptionFont { get; set; }
    Property Value
    Type
    System.Drawing.Font

    CaptionHeight

    Gets the height of caption.

    Declaration
    public virtual int CaptionHeight { get; }
    Property Value
    Type
    System.Int32

    CaptionMinHeight

    Gets or sets the minimum height of the caption.

    Declaration
    public virtual int CaptionMinHeight { get; set; }
    Property Value
    Type
    System.Int32

    CaptionStyle

    Gets or sets whether the caption should be aligned to top or bottom.

    Declaration
    public virtual CaptionStyle CaptionStyle { get; set; }
    Property Value
    Type
    CaptionStyle

    CaptionTextStyle

    Gets or sets whether the caption text should be drawn etched, plain or with shadow.

    Declaration
    public virtual CaptionTextStyle CaptionTextStyle { get; set; }
    Property Value
    Type
    CaptionTextStyle

    ClickThrough

    Gets or sets whether the ToolStripEx honors item clicks when its containing form does not have input focus

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

    Returns false value

    CollapsedDropDownButtonImage

    Gets or sets the image of collapsed state dropdown button.

    Declaration
    [Obsolete("Use Image instead.")]
    public Image CollapsedDropDownButtonImage { get; set; }
    Property Value
    Type
    System.Drawing.Image

    CollapsedDropDownButtonText

    Gets or sets the text of collapsed state dropdown button.

    Declaration
    public string CollapsedDropDownButtonText { get; set; }
    Property Value
    Type
    System.String

    CollapsedWidth

    Width of toolstrip in collapsed state.

    Declaration
    public int CollapsedWidth { get; }
    Property Value
    Type
    System.Int32

    DefaultMargin

    Declaration
    protected override Padding DefaultMargin { get; }
    Property Value
    Type
    System.Windows.Forms.Padding

    ExpandedSize

    Size of toolstrip in expanded state.

    Declaration
    public Size ExpandedSize { get; }
    Property Value
    Type
    System.Drawing.Size

    ForeColor

    Gets or sets control fore color.

    Declaration
    public virtual Color ForeColor { get; set; }
    Property Value
    Type
    System.Drawing.Color

    GroupedButtons

    Gets or Sets whether the buttons should be grouped.

    Declaration
    public virtual bool GroupedButtons { get; set; }
    Property Value
    Type
    System.Boolean

    Image

    Gets or sets the image of ToolStripEx (shown in quick items panel).

    Declaration
    public Image Image { get; set; }
    Property Value
    Type
    System.Drawing.Image

    IsVisualStyleEnabled

    Gets a value indicating whether the visual style based theme is applied to the control. This also indicates whether the theme files are referred from external assemblies or not.

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

    Return true, if the visual style based theme is applied to control. Otherwise returns false.

    LauncherSelected

    Gets a value indicating whether the launcher is selected.

    Declaration
    public virtual bool LauncherSelected { get; }
    Property Value
    Type
    System.Boolean

    LauncherStyle

    Gets or sets whether the launcher style should be Office12 or Office2007.

    Declaration
    public virtual LauncherStyle LauncherStyle { get; set; }
    Property Value
    Type
    LauncherStyle

    LayoutEngine

    Gets a cached instance of the control's layout engine. (overridden property)

    Declaration
    public override LayoutEngine LayoutEngine { get; }
    Property Value
    Type
    System.Windows.Forms.Layout.LayoutEngine

    Office12Mode

    Gets or sets a value indicating whether Office12 mode should be turned on.

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

    true if [office12 mode]; otherwise, false.

    OfficeColorScheme

    Gets or sets whether the Office color scheme should be Silver or Blue.

    Declaration
    public virtual ToolStripEx.ColorScheme OfficeColorScheme { get; set; }
    Property Value
    Type
    ToolStripEx.ColorScheme

    ShowCaption

    Gets or Sets whether the caption should be shown or not.

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

    true, if caption should be shown, false otherwise

    ShowItemToolTips

    Gets or sets a value indicating whether ToolTips are to be displayed on the Toolstrip items.

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

    ShowLauncher

    Gets or Sets whether the Launcher should be shown or not.

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

    true, if Launcher should be shown, false otherwise

    State

    Gets or sets state of ToolStripEx.

    Declaration
    public ToolStripEx.ToolStripExState State { get; set; }
    Property Value
    Type
    ToolStripEx.ToolStripExState

    TabItem

    Gets or sets corresponding ToolStripTabItem.

    Declaration
    public ToolStripTabItem TabItem { get; set; }
    Property Value
    Type
    ToolStripTabItem

    ThemeName

    Gets or sets the theme name of the ToolStripEx control.

    Declaration
    public string ThemeName { get; set; }
    Property Value
    Type
    System.String

    ThemeStyle

    Declaration
    public ToolStripExStyleInfo ThemeStyle { get; set; }
    Property Value
    Type
    ToolStripExStyleInfo

    VisualStyle

    Gets or sets an advanced appearance for the ToolStripEx.

    Declaration
    public ToolStripExStyle VisualStyle { get; set; }
    Property Value
    Type
    ToolStripExStyle

    Methods

    BoolExToBool(BoolEx)

    Converts BoolEx to bool.

    Declaration
    public static bool BoolExToBool(BoolEx boolEx)
    Parameters
    Type Name Description
    BoolEx boolEx

    Input BoolEx.

    Returns
    Type Description
    System.Boolean

    Output bool.

    BoolToBoolEx(Boolean)

    Converts bool to BoolEx.

    Declaration
    public static BoolEx BoolToBoolEx(bool bBool)
    Parameters
    Type Name Description
    System.Boolean bBool

    Input bool.

    Returns
    Type Description
    BoolEx

    Output BoolEx.

    Dispose(Boolean)

    Declaration
    protected override void Dispose(bool disposing)
    Parameters
    Type Name Description
    System.Boolean disposing

    GetActiveThemeName()

    Gets the active theme name of the ToolStripEx control.

    Declaration
    public string GetActiveThemeName()
    Returns
    Type Description
    System.String

    Returns the active theme name.

    GetItems()

    Returns collection of toolstrip items. Pays caution to the state of toolstrip.

    Declaration
    public ToolStripItemCollection GetItems()
    Returns
    Type Description
    System.Windows.Forms.ToolStripItemCollection

    Collection of toolstrip items.

    GetPreferredSize(Size)

    Retrieves the size of a rectangular area into which a control can be fitted.

    Declaration
    public override Size GetPreferredSize(Size szProposed)
    Parameters
    Type Name Description
    System.Drawing.Size szProposed

    The custom-sized area for a control.

    Returns
    Type Description
    System.Drawing.Size

    An ordered pair of type System.Drawing.Size representing the width and height of a rectangle.

    OnFontChanged(EventArgs)

    Declaration
    protected override void OnFontChanged(EventArgs e)
    Parameters
    Type Name Description
    System.EventArgs e

    OnForeColorChanged(EventArgs)

    Raises the ForeChanged event.

    Declaration
    protected override void OnForeColorChanged(EventArgs e)
    Parameters
    Type Name Description
    System.EventArgs e

    OnHandleDestroyed(EventArgs)

    Declaration
    protected override void OnHandleDestroyed(EventArgs e)
    Parameters
    Type Name Description
    System.EventArgs e

    OnItemAdded(ToolStripItemEventArgs)

    Declaration
    protected override void OnItemAdded(ToolStripItemEventArgs e)
    Parameters
    Type Name Description
    System.Windows.Forms.ToolStripItemEventArgs e

    OnItemRemoved(ToolStripItemEventArgs)

    Removes the added.

    Declaration
    protected override void OnItemRemoved(ToolStripItemEventArgs e)
    Parameters
    Type Name Description
    System.Windows.Forms.ToolStripItemEventArgs e

    Provides data for

    OnLauncherClick()

    Declaration
    protected virtual void OnLauncherClick()

    OnLayoutCompleted(EventArgs)

    Declaration
    protected override void OnLayoutCompleted(EventArgs e)
    Parameters
    Type Name Description
    System.EventArgs e

    OnMouseClick(MouseEventArgs)

    Declaration
    protected override void OnMouseClick(MouseEventArgs e)
    Parameters
    Type Name Description
    System.Windows.Forms.MouseEventArgs e

    OnMouseLeave(EventArgs)

    Declaration
    protected override void OnMouseLeave(EventArgs e)
    Parameters
    Type Name Description
    System.EventArgs e

    OnMouseMove(MouseEventArgs)

    Declaration
    protected override void OnMouseMove(MouseEventArgs e)
    Parameters
    Type Name Description
    System.Windows.Forms.MouseEventArgs e

    OnPaddingChanged(EventArgs)

    Declaration
    protected override void OnPaddingChanged(EventArgs e)
    Parameters
    Type Name Description
    System.EventArgs e

    OnPaint(PaintEventArgs)

    Declaration
    protected override void OnPaint(PaintEventArgs e)
    Parameters
    Type Name Description
    System.Windows.Forms.PaintEventArgs e

    OnParentChanged(EventArgs)

    Raises the ParentChanged event.

    Declaration
    protected override void OnParentChanged(EventArgs e)
    Parameters
    Type Name Description
    System.EventArgs e

    OnRendererChanged(EventArgs)

    Declaration
    protected override void OnRendererChanged(EventArgs e)
    Parameters
    Type Name Description
    System.EventArgs e

    OnSizeChanged(EventArgs)

    Declaration
    protected override void OnSizeChanged(EventArgs e)
    Parameters
    Type Name Description
    System.EventArgs e

    OnStateChanging()

    Declaration
    protected virtual bool OnStateChanging()
    Returns
    Type Description
    System.Boolean

    Returns true to allow changing of State property

    OnTextChanged(EventArgs)

    Declaration
    protected override void OnTextChanged(EventArgs e)
    Parameters
    Type Name Description
    System.EventArgs e

    OnVisibleChanged(EventArgs)

    Raises the Visible Changed event when visibility of ToolStripEx is changed

    Declaration
    protected override void OnVisibleChanged(EventArgs e)
    Parameters
    Type Name Description
    System.EventArgs e

    PerformLauncherClick()

    Imitates launcher clicking.

    Declaration
    public void PerformLauncherClick()

    ResetFont()

    Occurs when the ToolStrip State is Changing.

    Declaration
    public override void ResetFont()

    WndProc(ref Message)

    Declaration
    protected override void WndProc(ref Message m)
    Parameters
    Type Name Description
    System.Windows.Forms.Message m

    Events

    CollapsedDropdownClosing

    Declaration
    public event ToolStripDropDownClosingEventHandler CollapsedDropdownClosing
    Event Type
    Type
    System.Windows.Forms.ToolStripDropDownClosingEventHandler

    ImageChanged

    Occurs when the image is changed

    Declaration
    public event EventHandler ImageChanged
    Event Type
    Type
    System.EventHandler

    LauncherClick

    Declaration
    public event EventHandler LauncherClick
    Event Type
    Type
    System.EventHandler

    LauncherMouseEnter

    Declaration
    public event ToolStripEx.LauncherEnter LauncherMouseEnter
    Event Type
    Type
    ToolStripEx.LauncherEnter

    LauncherMouseLeave

    Declaration
    public event ToolStripEx.LauncherLeave LauncherMouseLeave
    Event Type
    Type
    ToolStripEx.LauncherLeave

    StateChanging

    Declaration
    public event CancelEventHandler StateChanging
    Event Type
    Type
    System.ComponentModel.CancelEventHandler

    ThemeNameChanged

    Occurs when theme name of the ToolStripEx has changed.

    Declaration
    public event ThemeChangedEventHandler ThemeNameChanged
    Event Type
    Type
    ThemeChangedEventHandler

    Explicit Interface Implementations

    IVisualStyle.VisualTheme

    Gets or sets the VisualTheme of the ToolStripEx control.

    Declaration
    string IVisualStyle.VisualTheme { get; set; }
    Returns
    Type
    System.String

    INativeMessageFilter.ProcessMessage(ref Message)

    Declaration
    bool INativeMessageFilter.ProcessMessage(ref Message m)
    Parameters
    Type Name Description
    System.Windows.Forms.Message m
    Returns
    Type
    System.Boolean

    IThemeProvider.BaseThemeName

    Gets or sets the BaseTheme name of the theme

    Declaration
    string IThemeProvider.BaseThemeName { get; set; }
    Returns
    Type
    System.String

    IThemeProvider.ControlName

    Gets the name of the control.

    Declaration
    string IThemeProvider.ControlName { get; }
    Returns
    Type
    System.String

    Implements

    IThemeProvider
    IVisualStyle
    IToolStripExSupport2
    IToolStripExSupport
    INativeMessageFilter
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved