WinForms

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class BarItemRenderer

    Show / Hide Table of Contents

    Class BarItemRenderer

    Inheritance
    System.Object
    BarItemRenderer
    ComboBoxItemRenderer
    DropDownBarItemRenderer
    StaticBarItemRenderer
    TextBoxBarItemRenderer
    Implements
    IBarItemRenderer
    System.IDisposable
    Inherited Members
    System.Object.ToString()
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    Namespace: Syncfusion.Windows.Forms.Tools.XPMenus
    Assembly: Syncfusion.Tools.Windows.dll
    Syntax
    public class BarItemRenderer : IBarItemRenderer, IDisposable

    Constructors

    BarItemRenderer(IBarRenderer)

    Declaration
    public BarItemRenderer(IBarRenderer parent)
    Parameters
    Type Name Description
    IBarRenderer parent

    Fields

    DropDownAreaX

    Declaration
    public static int DropDownAreaX
    Field Value
    Type Description
    System.Int32

    ImageTextPadding

    Declaration
    public static int ImageTextPadding
    Field Value
    Type Description
    System.Int32

    lastDrawnBounds

    Declaration
    protected RectangleF lastDrawnBounds
    Field Value
    Type Description
    System.Drawing.RectangleF

    PadX

    Declaration
    public static int PadX
    Field Value
    Type Description
    System.Int32

    PadY

    Declaration
    public static int PadY
    Field Value
    Type Description
    System.Int32

    parent

    Declaration
    protected IBarRenderer parent
    Field Value
    Type Description
    IBarRenderer

    showDefaultSelectionInDropdown

    Declaration
    protected bool showDefaultSelectionInDropdown
    Field Value
    Type Description
    System.Boolean

    Properties

    Active

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

    BarItem

    Declaration
    public virtual BarItem BarItem { get; set; }
    Property Value
    Type Description
    BarItem

    Bounds

    Declaration
    public virtual RectangleF Bounds { get; set; }
    Property Value
    Type Description
    System.Drawing.RectangleF

    HotTrack

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

    IsDisposed

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

    IsHorizontalAligned

    Declaration
    protected bool IsHorizontalAligned { get; }
    Property Value
    Type Description
    System.Boolean

    IsParentMainMenu

    Declaration
    protected bool IsParentMainMenu { get; }
    Property Value
    Type Description
    System.Boolean

    IsRTL

    Declaration
    protected bool IsRTL { get; }
    Property Value
    Type Description
    System.Boolean

    NeedCenterVAlign

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

    ShowDropShadow

    Declaration
    protected bool ShowDropShadow { get; }
    Property Value
    Type Description
    System.Boolean

    ShowHighlightRectangle

    Declaration
    protected bool ShowHighlightRectangle { get; }
    Property Value
    Type Description
    System.Boolean

    ShowingDropDown

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

    Style

    Declaration
    public VisualStyle Style { get; set; }
    Property Value
    Type Description
    VisualStyle

    ThemesEnabled

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

    Visible

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

    Methods

    AddTextPreferredSize(IGraphicsProvider, ref SizeF)

    Declaration
    public virtual void AddTextPreferredSize(IGraphicsProvider gp, ref SizeF preferredSize)
    Parameters
    Type Name Description
    IGraphicsProvider gp
    System.Drawing.SizeF preferredSize

    ApplyTransform(Graphics)

    Declaration
    protected virtual void ApplyTransform(Graphics g)
    Parameters
    Type Name Description
    System.Drawing.Graphics g

    BarItemPropertyChanged(SyncfusionPropertyChangedEventArgs)

    Declaration
    public virtual void BarItemPropertyChanged(SyncfusionPropertyChangedEventArgs e)
    Parameters
    Type Name Description
    SyncfusionPropertyChangedEventArgs e

    Dispose()

    Declaration
    public void Dispose()

    Dispose(Boolean)

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

    DrawBackground(DrawToolbarItemEventArgs, Boolean)

    Declaration
    protected virtual void DrawBackground(DrawToolbarItemEventArgs drawItemInfo, bool useThemes)
    Parameters
    Type Name Description
    DrawToolbarItemEventArgs drawItemInfo
    System.Boolean useThemes

    DrawBorders(DrawToolbarItemEventArgs, Boolean)

    Declaration
    protected virtual void DrawBorders(DrawToolbarItemEventArgs drawItemInfo, bool useThemes)
    Parameters
    Type Name Description
    DrawToolbarItemEventArgs drawItemInfo
    System.Boolean useThemes

    DrawFocusRect(Graphics, RectangleF, Color, Color)

    Declaration
    protected virtual void DrawFocusRect(Graphics g, RectangleF focusRect, Color fore, Color back)
    Parameters
    Type Name Description
    System.Drawing.Graphics g
    System.Drawing.RectangleF focusRect
    System.Drawing.Color fore
    System.Drawing.Color back

    DrawInterior(DrawToolbarItemEventArgs)

    Declaration
    protected virtual void DrawInterior(DrawToolbarItemEventArgs drawItemInfo)
    Parameters
    Type Name Description
    DrawToolbarItemEventArgs drawItemInfo

    DrawSeparator(Graphics)

    Declaration
    public virtual void DrawSeparator(Graphics g)
    Parameters
    Type Name Description
    System.Drawing.Graphics g

    DrawSeparator(Graphics, RectangleF)

    Declaration
    protected virtual void DrawSeparator(Graphics g, RectangleF fBounds)
    Parameters
    Type Name Description
    System.Drawing.Graphics g
    System.Drawing.RectangleF fBounds

    DrawText(Graphics, String, Font, Color, RectangleF, TextFormatFlags)

    Draws the text.

    Declaration
    protected void DrawText(Graphics g, string text, Font textFont, Color textColor, RectangleF rectText, TextFormatFlags format)
    Parameters
    Type Name Description
    System.Drawing.Graphics g

    The graphics.

    System.String text

    The text.

    System.Drawing.Font textFont
    System.Drawing.Color textColor

    Color of the text.

    System.Drawing.RectangleF rectText

    The rectangle of the text.

    System.Windows.Forms.TextFormatFlags format

    DrawTextAndImage(Graphics, RectangleF, Font, Brush, Color, DrawItemState)

    Declaration
    [Obsolete("Not used.")]
    protected virtual void DrawTextAndImage(Graphics g, RectangleF rectTextAndImage, Font textFont, Brush textBrush, Color bgColor, DrawItemState state)
    Parameters
    Type Name Description
    System.Drawing.Graphics g
    System.Drawing.RectangleF rectTextAndImage
    System.Drawing.Font textFont
    System.Drawing.Brush textBrush
    System.Drawing.Color bgColor
    System.Windows.Forms.DrawItemState state

    DrawTextAndImage(Graphics, RectangleF, Font, Color, Color, DrawItemState)

    Declaration
    protected virtual void DrawTextAndImage(Graphics g, RectangleF rectTextAndImage, Font textFont, Color textColor, Color bgColor, DrawItemState state)
    Parameters
    Type Name Description
    System.Drawing.Graphics g
    System.Drawing.RectangleF rectTextAndImage
    System.Drawing.Font textFont
    System.Drawing.Color textColor
    System.Drawing.Color bgColor
    System.Windows.Forms.DrawItemState state

    DropDown(Boolean, Boolean, Queue)

    Declaration
    public void DropDown(bool show, bool setDefaultSelection, Queue pbiQueue)
    Parameters
    Type Name Description
    System.Boolean show
    System.Boolean setDefaultSelection
    System.Collections.Queue pbiQueue

    Finalize()

    Declaration
    protected void Finalize()

    GetBGColor()

    Declaration
    protected virtual Color GetBGColor()
    Returns
    Type Description
    System.Drawing.Color

    GetBGColor2()

    Declaration
    protected virtual Color GetBGColor2()
    Returns
    Type Description
    System.Drawing.Color

    GetBorderCheckPen(String)

    Gets pen for border of the checked BarItem amenably with VisualStyle.

    Declaration
    protected Pen GetBorderCheckPen(string themeName)
    Parameters
    Type Name Description
    System.String themeName
    Returns
    Type Description
    System.Drawing.Pen

    GetBorderPen(String)

    Gets pen for border of the BarItem amenably with VisualStyle.

    Declaration
    protected Pen GetBorderPen(string themeName)
    Parameters
    Type Name Description
    System.String themeName
    Returns
    Type Description
    System.Drawing.Pen

    GetBorderPressPen(String)

    Gets pen for border of the pressed BarItem amenably with VisualStyle.

    Declaration
    protected Pen GetBorderPressPen(string themeName)
    Parameters
    Type Name Description
    System.String themeName
    Returns
    Type Description
    System.Drawing.Pen

    GetCheckedItemLightColor(VisualStyle)

    Gets light color of the checked BarItem amenably with VisualStyle.

    Declaration
    protected virtual Color GetCheckedItemLightColor(VisualStyle style)
    Parameters
    Type Name Description
    VisualStyle style
    Returns
    Type Description
    System.Drawing.Color

    GetCurrentThemeState(DrawToolbarItemEventArgs)

    Declaration
    protected virtual int GetCurrentThemeState(DrawToolbarItemEventArgs drawItemInfo)
    Parameters
    Type Name Description
    DrawToolbarItemEventArgs drawItemInfo
    Returns
    Type Description
    System.Int32

    GetDrawingBounds()

    Declaration
    protected virtual RectangleF GetDrawingBounds()
    Returns
    Type Description
    System.Drawing.RectangleF

    GetDrawState()

    Gets state for drawing of the BarItem.

    Declaration
    protected virtual ItemState GetDrawState()
    Returns
    Type Description
    ItemState

    GetDropDownAreaWidth()

    Declaration
    protected int GetDropDownAreaWidth()
    Returns
    Type Description
    System.Int32

    GetForeColor(DrawItemState)

    Declaration
    protected virtual Color GetForeColor(DrawItemState state)
    Parameters
    Type Name Description
    System.Windows.Forms.DrawItemState state
    Returns
    Type Description
    System.Drawing.Color

    GetForeColorDefault(DrawItemState)

    Gets fore color for default visual style.

    Declaration
    protected virtual Color GetForeColorDefault(DrawItemState state)
    Parameters
    Type Name Description
    System.Windows.Forms.DrawItemState state
    Returns
    Type Description
    System.Drawing.Color

    GetForeColorOffice2003(DrawItemState)

    Gets fore color for Office2003 visual style.

    Declaration
    protected virtual Color GetForeColorOffice2003(DrawItemState state)
    Parameters
    Type Name Description
    System.Windows.Forms.DrawItemState state
    Returns
    Type Description
    System.Drawing.Color

    GetForeColorOffice2007(DrawItemState)

    Gets fore color for Office2007 visual style.

    Declaration
    protected virtual Color GetForeColorOffice2007(DrawItemState state)
    Parameters
    Type Name Description
    System.Windows.Forms.DrawItemState state
    Returns
    Type Description
    System.Drawing.Color

    GetForeColorOffice2010(DrawItemState)

    Gets fore color for Office2010 visual style.

    Declaration
    protected virtual Color GetForeColorOffice2010(DrawItemState state)
    Parameters
    Type Name Description
    System.Windows.Forms.DrawItemState state
    Returns
    Type Description
    System.Drawing.Color

    GetForeColorOffice2016(DrawItemState)

    Fore color for office2016 themes

    Declaration
    protected virtual Color GetForeColorOffice2016(DrawItemState state)
    Parameters
    Type Name Description
    System.Windows.Forms.DrawItemState state
    Returns
    Type Description
    System.Drawing.Color

    GetForeColorVS2005(DrawItemState)

    Gets fore color for VS2005 visual style.

    Declaration
    protected virtual Color GetForeColorVS2005(DrawItemState state)
    Parameters
    Type Name Description
    System.Windows.Forms.DrawItemState state
    Returns
    Type Description
    System.Drawing.Color

    GetHighlightItemDarkColor(VisualStyle)

    Gets dark color of the highlighted BarItem amenably with VisualStyle.

    Declaration
    protected virtual Color GetHighlightItemDarkColor(VisualStyle style)
    Parameters
    Type Name Description
    VisualStyle style
    Returns
    Type Description
    System.Drawing.Color

    GetHighlightItemLightColor(VisualStyle)

    Gets light color of the highlighted BarItem amenably with VisualStyle.

    Declaration
    protected virtual Color GetHighlightItemLightColor(VisualStyle style)
    Parameters
    Type Name Description
    VisualStyle style
    Returns
    Type Description
    System.Drawing.Color

    GetMainManager()

    Declaration
    protected MainFrameBarManager GetMainManager()
    Returns
    Type Description
    MainFrameBarManager

    GetPreferredSize(IGraphicsProvider)

    Declaration
    public virtual SizeF GetPreferredSize(IGraphicsProvider gp)
    Parameters
    Type Name Description
    IGraphicsProvider gp
    Returns
    Type Description
    System.Drawing.SizeF

    GetPressedItemDarktColor(VisualStyle)

    Gets dark color of the pressed BarItem amenably with VisualStyle.

    Declaration
    protected virtual Color GetPressedItemDarktColor(VisualStyle style)
    Parameters
    Type Name Description
    VisualStyle style
    Returns
    Type Description
    System.Drawing.Color

    GetPressedItemLightColor(VisualStyle)

    Gets light color of the pressed BarItem amenably with VisualStyle.

    Declaration
    protected virtual Color GetPressedItemLightColor(VisualStyle style)
    Parameters
    Type Name Description
    VisualStyle style
    Returns
    Type Description
    System.Drawing.Color

    GetTextAndImageRect(Graphics, Rectangle)

    Declaration
    protected virtual RectangleF GetTextAndImageRect(Graphics g, Rectangle clippingRect)
    Parameters
    Type Name Description
    System.Drawing.Graphics g
    System.Drawing.Rectangle clippingRect
    Returns
    Type Description
    System.Drawing.RectangleF

    GetTextPosition(Graphics, String, Font, RectangleF, StringFormat)

    Declaration
    [Obsolete("Not used.")]
    public virtual RectangleF GetTextPosition(Graphics g, string text, Font font, RectangleF rectLayout, StringFormat stringformat)
    Parameters
    Type Name Description
    System.Drawing.Graphics g
    System.String text
    System.Drawing.Font font
    System.Drawing.RectangleF rectLayout
    System.Drawing.StringFormat stringformat
    Returns
    Type Description
    System.Drawing.RectangleF

    GetTextPosition(Graphics, String, Font, RectangleF, TextFormatFlags)

    Declaration
    public virtual RectangleF GetTextPosition(Graphics g, string text, Font font, RectangleF rectLayoutF, TextFormatFlags format)
    Parameters
    Type Name Description
    System.Drawing.Graphics g
    System.String text
    System.Drawing.Font font
    System.Drawing.RectangleF rectLayoutF
    System.Windows.Forms.TextFormatFlags format
    Returns
    Type Description
    System.Drawing.RectangleF

    HideDropDown()

    Declaration
    protected virtual void HideDropDown()

    HitTest(PointF)

    Declaration
    public virtual bool HitTest(PointF mousePosition)
    Parameters
    Type Name Description
    System.Drawing.PointF mousePosition
    Returns
    Type Description
    System.Boolean

    InvalidateCachedTextSizes()

    Declaration
    public virtual void InvalidateCachedTextSizes()

    IsMouseDown()

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

    IsTextOnly()

    Declaration
    protected bool IsTextOnly()
    Returns
    Type Description
    System.Boolean

    MeasureText(Graphics, String, Font)

    Measures text with default text format.

    Declaration
    protected Size MeasureText(Graphics g, string text, Font font)
    Parameters
    Type Name Description
    System.Drawing.Graphics g

    The graphics.

    System.String text

    The text.

    System.Drawing.Font font

    The text's font.

    Returns
    Type Description
    System.Drawing.Size

    Size of the measured text.

    MeasureText(Graphics, String, Font, TextFormatFlags)

    Measures text.

    Declaration
    protected Size MeasureText(Graphics g, string text, Font font, TextFormatFlags textFormat)
    Parameters
    Type Name Description
    System.Drawing.Graphics g

    The graphics.

    System.String text

    The text.

    System.Drawing.Font font

    The text's font.

    System.Windows.Forms.TextFormatFlags textFormat

    The text's format.

    Returns
    Type Description
    System.Drawing.Size

    Size of the measured text.

    OnMouseDown(Point)

    Declaration
    public virtual void OnMouseDown(Point pointMouseDown)
    Parameters
    Type Name Description
    System.Drawing.Point pointMouseDown

    OnMouseMove(Point)

    Declaration
    public virtual void OnMouseMove(Point pointMouseMove)
    Parameters
    Type Name Description
    System.Drawing.Point pointMouseMove

    OnMouseUp(Point)

    Declaration
    public virtual void OnMouseUp(Point pointMouseUp)
    Parameters
    Type Name Description
    System.Drawing.Point pointMouseUp

    OnMouseWheel(Boolean)

    Declaration
    public virtual void OnMouseWheel(bool isUp)
    Parameters
    Type Name Description
    System.Boolean isUp

    OnPaint(Graphics, Rectangle)

    Declaration
    public virtual void OnPaint(Graphics g, Rectangle clippingRect)
    Parameters
    Type Name Description
    System.Drawing.Graphics g
    System.Drawing.Rectangle clippingRect

    ProcessKeyDown(Keys)

    Declaration
    public virtual bool ProcessKeyDown(Keys key)
    Parameters
    Type Name Description
    System.Windows.Forms.Keys key
    Returns
    Type Description
    System.Boolean

    Repaint()

    Declaration
    protected void Repaint()

    ShouldDrawImage()

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

    ShouldDrawText()

    Declaration
    public virtual bool ShouldDrawText()
    Returns
    Type Description
    System.Boolean

    ShowDropDown(Queue)

    Declaration
    protected virtual bool ShowDropDown(Queue pbiQueue)
    Parameters
    Type Name Description
    System.Collections.Queue pbiQueue
    Returns
    Type Description
    System.Boolean

    Implements

    IBarItemRenderer
    System.IDisposable
    Back to top Generated by DocFX
    Copyright © 2001 - 2023 Syncfusion Inc. All Rights Reserved