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 class.
public CommandButton()
Properties
CanDrawStates
Indicates whether the button can draw states.
public bool CanDrawStates { get; set; }
Property Value
- bool:
trueif 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:
trueif the mouse should automatically be captured when the element is pressed; otherwise,false.
Command
The ICommand for the button.
Image
The image.
IsCheckable
Indicates whether the button is checkable.
public bool IsCheckable { get; set; }
Property Value
- bool:
trueif the button is checkable; otherwise,false.
IsChecked
Indicates whether the button is checked.
public bool IsChecked { get; set; }
Property Value
- bool:
trueif 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()
Invoked when the logical parent is changed. This is invoked after the parent has changed, and the purpose is to allow elements to perform actions based on the changed parent.
protected override void OnParentChanged()
OnRender(PaintEventArgs)
Renders the element.
protected override void OnRender(PaintEventArgs e)
| Parameter | Type | Description |
|---|---|---|
| e | PaintEventArgs | 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 | A Message, passed by reference, that represents the window message to process. |
| keyData | Keys | One of the Keys values that represents the key to process. |
Returns
- bool:
trueif the character was processed by the control; otherwise,false.
Inherited Members
- UIControl.Dispose(bool)
- UIControl.AddPendingGraphicsInversion(Rectangle)
- UIControl.AddPendingScrollOperation(Rectangle, Orientation, int)
- UIControl.AddPendingScrollOperation(Rectangle, int, int)
- UIControl.AddToInvalidatedRegion()
- UIControl.AddToInvalidatedRegion(Rectangle)
- UIControl.Arrange(Rectangle)
- UIControl.ArrangeOverride(Size)
- UIControl.ContainsLocation(Point)
- UIControl.CreateChildren()
- UIControl.DpiScaleChanged(SizeF)
- UIControl.GetCursor(Point)
- UIControl.HitTest(PointHitTestParameters, Func<IUIElement, PointHitTestParameters, bool>)
- UIControl.HitTestRecursive(PointHitTestParameters, Func<IUIElement, PointHitTestParameters, bool>)
- UIControl.Invalidate(InvalidationLevels, InvalidationTypes)
- UIControl.InvalidateArrange()
- UIControl.InvalidateMeasure()
- UIControl.Measure(Graphics, Size)
- UIControl.MeasureOverride(Graphics, Size)
- UIControl.OnClick(EventArgs)
- UIControl.OnDoubleClick(EventArgs)
- UIControl.OnDpiChangedAfterParent(EventArgs)
- UIControl.OnHandleCreated(EventArgs)
- UIControl.OnLayout(LayoutEventArgs)
- UIControl.OnLocationChanged(EventArgs)
- UIControl.OnMouseCaptureChanged(EventArgs)
- UIControl.OnMouseHover(EventArgs)
- UIControl.OnMouseMove(MouseEventArgs)
- UIControl.OnMouseWheel(MouseEventArgs)
- UIControl.OnPaint(PaintEventArgs)
- UIControl.OnPaintBackground(PaintEventArgs)
- UIControl.OnParentChanged(EventArgs)
- UIControl.OnRenderChildElements(PaintEventArgs)
- UIControl.OnResize(EventArgs)
- UIControl.OnRightToLeftChanged(EventArgs)
- UIControl.OnVisibleChanged(EventArgs)
- UIControl.Render(PaintEventArgs)
- UIControl.ResetDoubleBufferCanvas(bool)
- UIControl.ResumePainting()
- UIControl.SuspendPainting()
- UIControl.TransformToAncestor(IUIElement)
- UIControl.TransformToDescendant(IUIElement)
- UIControl.UpdateCursor()
- UIControl.UpdateCursor(Point)
- UIControl.UpdateLayout()
- UIControl.ActualHeight
- UIControl.ActualWidth
- UIControl.BackColor
- UIControl.BackgroundImage
- UIControl.ClipBounds
- UIControl.DesiredSize
- UIControl.DpiScaleFactor
- UIControl.Font
- UIControl.ForeColor
- UIControl.IsArrangeValid
- UIControl.IsMeasureValid
- UIControl.IsPaintValid
- UIControl.IsRightToLeft
- UIControl.LastMouseUpButton
- UIControl.PaintingSuspended
- UIControl.UseControlGraphicsForMeasure
- UIControl.UseExtendedDoubleBuffering
- MarshalByRefObject.GetLifetimeService()
- MarshalByRefObject.InitializeLifetimeService()
- MarshalByRefObject.MemberwiseClone(bool)
- object.GetType()
- object.MemberwiseClone()
- object.ToString()
- object.Equals(object)
- object.Equals(object, object)
- object.ReferenceEquals(object, object)
- object.GetHashCode()