In This Article

CommandButton Class

Defines a custom command button control.

public class CommandButton : UIControl, IUIControl, IUIElement, ILogicalTreeNode, IDpiAwareElement, IDisposable
Inheritance:
object MarshalByRefObject Component Control ScrollableControl UIControl object
Implements:
IUIControl IUIElement ILogicalTreeNode IDpiAwareElement IDisposable

Constructors

CommandButton()

Initializes an instance of the CommandButton class.

public CommandButton()

Properties

CanDrawStates

Gets or sets whether the button can draw states.

public bool CanDrawStates { get; set; }

Property Value

bool:

true if the button can draw states; otherwise, false.

CaptureMouseWhenPressed

Indicates whether to automatically capture the mouse when the element is pressed.

protected override bool CaptureMouseWhenPressed { get; }

Property Value

bool:

true if the mouse should automatically be captured when the element is pressed; otherwise, false.

Command

Gets the ICommand for the button.

public ICommand Command { get; set; }

Property Value

ICommand:

The ICommand for the button.

Image

Gets or sets the image.

public Image Image { get; set; }

Property Value

Image:

The image.

IsCheckable

Gets or sets whether the button is checkable.

public bool IsCheckable { get; set; }

Property Value

bool:

true if the button is checkable; otherwise, false.

IsChecked

Gets or sets whether the button is checked.

public bool IsChecked { get; set; }

Property Value

bool:

true if the button is checked; otherwise, false.

Methods

OnEnabledChanged(EventArgs)

Raises the EnabledChanged event.

protected override void OnEnabledChanged(EventArgs e)
Parameter Type Description
e EventArgs

An EventArgs that contains the event data.

OnGotFocus(EventArgs)

Raises the GotFocus event.

protected override void OnGotFocus(EventArgs e)
Parameter Type Description
e EventArgs

An EventArgs that contains the event data.

OnLostFocus(EventArgs)

Raises the LostFocus event.

protected override void OnLostFocus(EventArgs e)
Parameter Type Description
e EventArgs

An EventArgs that contains the event data.

OnMouseDown(MouseEventArgs)

Raises the MouseDown event.

protected override void OnMouseDown(MouseEventArgs e)
Parameter Type Description
e MouseEventArgs

A MouseEventArgs that contains the event data.

OnMouseEnter(EventArgs)

Raises the MouseEnter event.

protected override void OnMouseEnter(EventArgs e)
Parameter Type Description
e EventArgs

An EventArgs that contains the event data.

OnMouseLeave(EventArgs)

Raises the MouseLeave event.

protected override void OnMouseLeave(EventArgs e)
Parameter Type Description
e EventArgs

An EventArgs that contains the event data.

OnMouseUp(MouseEventArgs)

Raises the MouseUp event.

protected override void OnMouseUp(MouseEventArgs e)
Parameter Type Description
e MouseEventArgs

A MouseEventArgs that contains the event data.

OnParentChanged()

Occurs when the parent is changed.

protected override void OnParentChanged()

OnRender(PaintEventArgs)

Renders the element.

protected override void OnRender(PaintEventArgs e)
Parameter Type Description
e PaintEventArgs

A PaintEventArgs that contains the event data.

ProcessCmdKey(ref Message, Keys)

Processes a command key.

protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
Parameter Type Description
msg Message

The message.

keyData Keys

The key data to examine.

Returns

bool:

true if the specified key is processed; otherwise, false.

Inherited Members