Table of Contents

Class ExButton

Namespace
ExControls
Assembly
ExControls.dll

Extended Button control: in the custom style (DefaultStyle = false) it is flat with border and background colors for the hover, pressed and focus states (ExFlatAppearance).

[ToolboxBitmap(typeof(ToolboxIcons), "Toolbox.ExButton.ico")]
public class ExButton : Button, IDropTarget, ISynchronizeInvoke, IWin32Window, IBindableComponent, IComponent, IDisposable, IButtonControl, IExControl, IThemeable
Inheritance
ExButton
Implements
Derived
Inherited Members
Extension Methods

Constructors

ExButton()

Initializes a new instance of the ExButton class.

public ExButton()

Properties

DefaultStyle

Gets or sets whether the control uses the default Windows style; false = the custom style drawn by the control with its own colors.

[Browsable(true)]
[ExCategory(CategoryType.Appearance)]
[ExDescription("Default style of the Control.")]
public bool DefaultStyle { get; set; }

Property Value

bool

DisabledForeColor

Text color of a disabled button in the custom style: ForeColor faded towards BackColor.

[Browsable(false)]
public Color DisabledForeColor { get; }

Property Value

Color

ExFlatAppearance

Gets the border and background colors of the button for the mouse and focus states, used when DefaultStyle is false.

[Browsable(true)]
[ExCategory(CategoryType.Appearance)]
[ExDescription("ButtonFlatAppearance")]
public ExFlatButtonAppearance ExFlatAppearance { get; }

Property Value

ExFlatButtonAppearance

FlatStyle

Gets or sets the flat style appearance of the button. When DefaultStyle is false, the style is always Flat.

public FlatStyle FlatStyle { get; set; }

Property Value

FlatStyle

Methods

ApplyTheme(ExTheme)

Sets the colors and appearance of the control by the theme.

public virtual void ApplyTheme(ExTheme theme)

Parameters

theme ExTheme

OnDefaultStyleChanged()

Raises the DefaultStyleChanged event.

protected virtual void OnDefaultStyleChanged()

OnGotFocus(EventArgs)

Raises the GotFocus event.

protected override void OnGotFocus(EventArgs e)

Parameters

e EventArgs

An EventArgs that contains the event data.

OnLostFocus(EventArgs)

Raises the OnLostFocus(EventArgs) event.

protected override void OnLostFocus(EventArgs e)

Parameters

e EventArgs

An EventArgs that contains the event data.

OnMouseDown(MouseEventArgs)

Raises the OnMouseDown(MouseEventArgs) event.

protected override void OnMouseDown(MouseEventArgs mevent)

Parameters

mevent MouseEventArgs

A MouseEventArgs that contains the event data.

OnMouseEnter(EventArgs)

Raises the MouseEnter event.

protected override void OnMouseEnter(EventArgs e)

Parameters

e EventArgs

An EventArgs that contains the event data.

OnMouseLeave(EventArgs)

Raises the MouseLeave event.

protected override void OnMouseLeave(EventArgs e)

Parameters

e EventArgs

An EventArgs that contains the event data.

OnMouseUp(MouseEventArgs)

Raises the OnMouseUp(MouseEventArgs) event.

protected override void OnMouseUp(MouseEventArgs mevent)

Parameters

mevent MouseEventArgs

A MouseEventArgs that contains the event data.

OnPaint(PaintEventArgs)

Raises the OnPaint(PaintEventArgs) event.

protected override void OnPaint(PaintEventArgs pevent)

Parameters

pevent PaintEventArgs

A PaintEventArgs that contains the event data.

Events

DefaultStyleChanged

Occurs when the DefaultStyle property changes.

[ExCategory("Changed Property")]
[ExDescription("Occurs when the BorderColor property changes.")]
public event EventHandler? DefaultStyleChanged

Event Type

EventHandler