HypernovaDesktop Components · docs
Binarymission
WinFormsHeader Control › BinaryHeaderControl

BinaryHeaderControl

class.NET 6 / 8 / 10.NET Framework 4.8Binarymission.WinForms.Controls.NavigationControls

An "extended" MS Outlook (c) style "Navigation bar" header control.

public class BinaryHeaderControl : Panel

Inherits from / implements: Panel

Members at a glance

BinaryHeaderControlConstructs an instance of BinaryHeaderControl class.
AutoScrollGets the value indicating whether the auto-scroll is switched on or off.
BackgroundGradientDrawingDirectionGets or sets the background gradient drawing direction.
BorderColorGets or sets the color of the border.
BorderStyleIndicates the border style for the control.
BorderWidthGets or sets the width of the border.
ColorSchemeGets or sets the color scheme.
ContextMenuArrowColorGets or sets the color of the context menu arrow.
ContextMenuEllipseColorGets or sets the color of the context menu ellipse.
ContextMenuImageTypeGets or sets the type of the context menu image.
ContextMenuTypeGets or sets whether to use the menu object from the HeaderContextMenu or HeaderContextMenuStrip.
ControlIsInExpandedStateGets or sets whether the control is in expanded or collapsed state.
CustomContextMenuButtonImageTransparencyColorGets or sets the color of the custom context menu button image transparency.
CustomIconForContextMenuButtonGets or sets the custom image for context menu button.
CustomImageForContextMenuButtonGets or sets the custom image for context menu button.
DrawBorderAroundGets or sets the draw border around value from the DrawBorderAround enumeration.
DrawFooterGets or sets a value indicating whether to draw the footer.
EnableCollapseExpandButtonGets or sets whether to display and enable the collapse/expand button.
EnableHeaderContextMenuGets or sets a value indicating whether to enable header context menu.
EndColorForBackgroundRenderingGets or sets the end color for background gradient rendering.
EndColorForFooterRenderingGets or sets the end color for footer gradient rendering.
EndColorForHeaderRenderingGets or sets the end color for header gradient rendering.
ExpandCollapseCircleFillColorGets or sets the fill color of the expand / collapse circle.
ExpandCollapseUpDownArrowsFillColorGets or sets the fill color of the expand / collapse up / down arrows.
FooterBorderColorGets or sets the color of the footer border.
FooterBorderThicknessGets or sets the footer border weight.
FooterCaptionFontGets or sets the footer caption font.
FooterCaptionHeightGets or sets the height of the footer caption.
FooterGradientDrawingDirectionGets or sets the footer gradient drawing direction.
FooterTextGets or sets the footer text.
FooterTextForeColorGets or sets the forecolor to be used for drawing the footer area text.
FooterTextStringFormatGets or sets the footer text string format.
HeaderBitmapTransparencyColorGets or sets the color of the header bitmap transparency.
HeaderBorderColorGets or sets the color of the header border.
HeaderBorderThicknessGets or sets the header border weight.
HeaderCaptionFontGets or sets the header caption font.
HeaderCaptionHeightGets or sets the height of the header caption.
HeaderContextMenuGets or sets the header context menu that will be shown when clicked on the right-hand side corner (in the header) context menu button.
HeaderContextMenuStripGets or sets the header context menu that will be shown when clicked on the right-hand side corner (in the header) context menu button.
HeaderFooterDrawingStyleGets or sets the header and footer drawing style.
HeaderGradientDrawingDirectionGets or sets the header gradient drawing direction.
HeaderIconGets or sets the header icon.
HeaderImageGets or sets the header image.
HeaderImageTypeGets or sets the type of the header image.
HeaderLocationGets or sets the header location.
HeaderTextGets or sets the header text.
HeaderTextForeColorGets or sets the forecolor to be used for drawing the Header area text.
HeaderTextStringFormatGets or sets the header text string format.
SizeThe size of the header. Hidden from the base so that setting it can re-lay the header's content, which a plain assignment to the inherited property would not do.
StartColorForBackgroundRenderingGets or sets the start color for background gradient rendering.
StartColorForFooterRenderingGets or sets the start color for footer gradient rendering.
StartColorForHeaderRenderingGets or sets the start color for header gradient rendering.
UseAntiAliasingAsHeaderCaptionTextRenderingHintGets or sets a value indicating whether [use anti aliasing as header caption text rendering hint].
UseCustomImageForContextMenuButtonGets or sets a value indicating whether to use custom image for context menu button.
OnFontChangedRaises the FontChanged event. BinaryHeaderControl overrides it so that a caption font nobody has set explicitly keeps following the control's own font.
OnPaintRaises the Paint event. BinaryHeaderControl overrides it so the control's own handling runs alongside the base behavior.
OnPaintBackgroundRaises the PaintBackground event. BinaryHeaderControl overrides it so the control's own handling runs alongside the base behavior.
OnResizeRaises the Resize event. BinaryHeaderControl overrides it so the control's own handling runs alongside the base behavior.
PerformCollapseExpandLets you perform the collapse / expand of the control deterministically.
WndProcProcesses the Windows messages sent to this control's window.
FooterClickedThis event is raised when the user clicks on any location in the Footer area of the control.
HeaderClickedThis event is raised when the user clicks on any location in the Header area of the control.
HeaderContextMenuAboutToBeDisplayedThis event is raised when the context menu in the header area is about to be displayed.
Refer to the the delegate HeaderContextMenuAboutToBeDisplayedHandler for information.

Constructors

BinaryHeaderControl

public BinaryHeaderControl() : base()

Constructs an instance of BinaryHeaderControl class.

Properties

AutoScroll

public new bool AutoScroll

Gets the value indicating whether the auto-scroll is switched on or off.

The auto-scrolling is always switched off. If you want to make the client area of the control as scrollable, please add an instance of BinaryScrollablePanel control into the client area of this control and then place any child controls on this surface.

BackgroundGradientDrawingDirection

public LinearGradientMode BackgroundGradientDrawingDirection

Gets or sets the background gradient drawing direction.

Value. The background gradient drawing direction.

BorderColor

public Color BorderColor

Gets or sets the color of the border.

Value. The color of the border.

BorderStyle

public new BorderStyle BorderStyle

Indicates the border style for the control.

The border style is always set to None.

BorderWidth

public int BorderWidth

Gets or sets the width of the border.

Value. The width of the border.

ColorScheme

public ColorScheme ColorScheme

Gets or sets the color scheme.

Value. The color scheme.

ContextMenuArrowColor

public Color ContextMenuArrowColor

Gets or sets the color of the context menu arrow.

Value. The color of the context menu arrow.

This property is only effective if the UseCustomImageForContextMenuButton property is set to false and ContextMenuButtonImageType is set to ContextMenuButtonImageType.Default value.

ContextMenuEllipseColor

public Color ContextMenuEllipseColor

Gets or sets the color of the context menu ellipse.

Value. The color of the context menu ellipse.

This property is only effective if the UseCustomImageForContextMenuButton property is set to false and ContextMenuButtonImageType is set to ContextMenuButtonImageType.Default value.

ContextMenuImageType

public ContextMenuButtonImageType ContextMenuImageType

Gets or sets the type of the context menu image.

Value. The type of the context menu image.

ContextMenuType

public ContextMenuType ContextMenuType

Gets or sets whether to use the menu object from the HeaderContextMenu or HeaderContextMenuStrip.

For backward compatibility purposes, the control supports using the basic ContextMenu object as well for displaying context menu in the header area.
And hence this property exists.
Depending on what context menu you want the control to use, set this property with the appropriate value from the enumeration ContextMenuType.

ControlIsInExpandedState

public bool ControlIsInExpandedState

Gets or sets whether the control is in expanded or collapsed state.

CustomContextMenuButtonImageTransparencyColor

public Color CustomContextMenuButtonImageTransparencyColor

Gets or sets the color of the custom context menu button image transparency.

Value. The color of the custom context menu button image transparency.

CustomIconForContextMenuButton

public Icon CustomIconForContextMenuButton

Gets or sets the custom image for context menu button.

Value. The custom image for context menu button.

CustomImageForContextMenuButton

public Bitmap CustomImageForContextMenuButton

Gets or sets the custom image for context menu button.

Value. The custom image for context menu button.

DrawBorderAround

public DrawBorderAround DrawBorderAround

Gets or sets the draw border around value from the DrawBorderAround enumeration.

By default, the border drawing will be switched Off.
For more details, refer to DrawBorderAround.

DrawFooter

public bool DrawFooter

Gets or sets a value indicating whether to draw the footer.

Value. true if to draw the footer, otherwise, false .

EnableCollapseExpandButton

public bool EnableCollapseExpandButton

Gets or sets whether to display and enable the collapse/expand button.

Note that enabling this feature will disable the header context menu display feature.

EnableHeaderContextMenu

public bool EnableHeaderContextMenu

Gets or sets a value indicating whether to enable header context menu.

Value. true if to enable header context menu; otherwise, false .

EndColorForBackgroundRendering

public Color EndColorForBackgroundRendering

Gets or sets the end color for background gradient rendering.

Value. The end color for background rendering.

EndColorForFooterRendering

public Color EndColorForFooterRendering

Gets or sets the end color for footer gradient rendering.

Value. The end color for footer rendering.

EndColorForHeaderRendering

public Color EndColorForHeaderRendering

Gets or sets the end color for header gradient rendering.

Value. The end color for header rendering.

ExpandCollapseCircleFillColor

public Color ExpandCollapseCircleFillColor

Gets or sets the fill color of the expand / collapse circle.

ExpandCollapseUpDownArrowsFillColor

public Color ExpandCollapseUpDownArrowsFillColor

Gets or sets the fill color of the expand / collapse up / down arrows.

FooterBorderColor

public Color FooterBorderColor

Gets or sets the color of the footer border.

Value. The color of the footer border.

FooterBorderThickness

public float FooterBorderThickness

Gets or sets the footer border weight.

Value. The footer border weight.

FooterCaptionFont

public Font FooterCaptionFont

Gets or sets the footer caption font.

Value. The footer caption font.

FooterCaptionHeight

public int FooterCaptionHeight

Gets or sets the height of the footer caption.

Value. The height of the footer caption.

FooterGradientDrawingDirection

public LinearGradientMode FooterGradientDrawingDirection

Gets or sets the footer gradient drawing direction.

Value. The footer gradient drawing direction.

FooterText

public string FooterText

Gets or sets the footer text.

Value. The footer text.

FooterTextForeColor

public Color FooterTextForeColor

Gets or sets the forecolor to be used for drawing the footer area text.

FooterTextStringFormat

public StringFormat FooterTextStringFormat

Gets or sets the footer text string format.

Value. The footer text string format.

HeaderBitmapTransparencyColor

public Color HeaderBitmapTransparencyColor

Gets or sets the color of the header bitmap transparency.

Value. The color of the header bitmap transparency.

HeaderBorderColor

public Color HeaderBorderColor

Gets or sets the color of the header border.

Value. The color of the header border.

HeaderBorderThickness

public float HeaderBorderThickness

Gets or sets the header border weight.

Value. The header border weight.

HeaderCaptionFont

public Font HeaderCaptionFont

Gets or sets the header caption font.

Value. The header caption font.

HeaderCaptionHeight

public int HeaderCaptionHeight

Gets or sets the height of the header caption.

Value. The height of the header caption.

HeaderContextMenu

public ContextMenu HeaderContextMenu

Gets or sets the header context menu that will be shown when clicked on the right-hand side corner (in the header) context menu button.

Value. The header context menu.

HeaderContextMenuStrip

public ContextMenuStrip HeaderContextMenuStrip

Gets or sets the header context menu that will be shown when clicked on the right-hand side corner (in the header) context menu button.

Value. The header context menu.

HeaderFooterDrawingStyle

public HeaderFooterDrawingStyle HeaderFooterDrawingStyle

Gets or sets the header and footer drawing style.

Value. The header and footer drawing style.

HeaderGradientDrawingDirection

public LinearGradientMode HeaderGradientDrawingDirection

Gets or sets the header gradient drawing direction.

Value. The header gradient drawing direction.

HeaderIcon

public Icon HeaderIcon

Gets or sets the header icon.

Value. The header icon.

HeaderImage

public Bitmap HeaderImage

Gets or sets the header image.

Value. The header image.

HeaderImageType

public HeaderImageType HeaderImageType

Gets or sets the type of the header image.

Value. The type of the header image.

HeaderLocation

public HeaderLocation HeaderLocation

Gets or sets the header location.

Value. The header location.

HeaderText

public String HeaderText

Gets or sets the header text.

Value. The header text.

HeaderTextForeColor

public Color HeaderTextForeColor

Gets or sets the forecolor to be used for drawing the Header area text.

HeaderTextStringFormat

public StringFormat HeaderTextStringFormat

Gets or sets the header text string format.

Value. The header text string format.

Size

public new Size Size

The size of the header. Hidden from the base so that setting it can re-lay the header's content, which a plain assignment to the inherited property would not do.

StartColorForBackgroundRendering

public Color StartColorForBackgroundRendering

Gets or sets the start color for background gradient rendering.

Value. The start color for background rendering.

StartColorForFooterRendering

public Color StartColorForFooterRendering

Gets or sets the start color for footer gradient rendering.

Value. The start color for footer rendering.

StartColorForHeaderRendering

public Color StartColorForHeaderRendering

Gets or sets the start color for header gradient rendering.

Value. The start color for header rendering.

UseAntiAliasingAsHeaderCaptionTextRenderingHint

public bool UseAntiAliasingAsHeaderCaptionTextRenderingHint

Gets or sets a value indicating whether [use anti aliasing as header caption text rendering hint].

Value. true if [use anti aliasing as header caption text rendering hint]; otherwise, false .

UseCustomImageForContextMenuButton

public bool UseCustomImageForContextMenuButton

Gets or sets a value indicating whether to use custom image for context menu button.

Value. true if to use custom image for context menu button; otherwise, false .

Methods

OnFontChanged

protected override void OnFontChanged(EventArgs e)

Raises the FontChanged event. BinaryHeaderControl overrides it so that a caption font nobody has set explicitly keeps following the control's own font.

e
The data for the event.
The two caption fonts are copied from Font in the constructor and were never updated again, so a control given a font the ordinary way - an object initializer, a designer, an ambient font from its parent - went on drawing its caption and its footer in the default face. That also broke the band heights, which are now the larger of the property and the caption font's line height: the band was being sized against a font the control was not drawing with. A font assigned through HeaderCaptionFont or FooterCaptionFont is the caller's and is left alone; assigning null gives the inheritance back.

OnPaint

protected override void OnPaint(PaintEventArgs e)

Raises the Paint event. BinaryHeaderControl overrides it so the control's own handling runs alongside the base behavior.

e
The data for the event.

OnPaintBackground

protected override void OnPaintBackground(PaintEventArgs pevent)

Raises the PaintBackground event. BinaryHeaderControl overrides it so the control's own handling runs alongside the base behavior.

pevent
The data for the event.

OnResize

protected override void OnResize(EventArgs e)

Raises the Resize event. BinaryHeaderControl overrides it so the control's own handling runs alongside the base behavior.

e
The data for the event.

PerformCollapseExpand

public void PerformCollapseExpand(bool collapse)

Lets you perform the collapse / expand of the control deterministically.

collapse
if set to true [collapse].

WndProc

protected override void WndProc(ref Message theWindowMessage)

Processes the Windows messages sent to this control's window.

Events

FooterClicked

public event EventHandler FooterClicked

This event is raised when the user clicks on any location in the Footer area of the control.

HeaderClicked

public event EventHandler HeaderClicked

This event is raised when the user clicks on any location in the Header area of the control.

HeaderContextMenuAboutToBeDisplayed

public event HeaderContextMenuAboutToBeDisplayedHandler HeaderContextMenuAboutToBeDisplayed

This event is raised when the context menu in the header area is about to be displayed.
Refer to the the delegate HeaderContextMenuAboutToBeDisplayedHandler for information.