HypernovaDesktop Components · docs
Binarymission
WinFormsButton Suite › ExtendedCheckBox

ExtendedCheckBox

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

BinaryButtonSuite .NET is a collection of extended version of CheckBox and Radio button .NET controls for the WinForms .NET platform!
This class extends the standard .NET CheckBox control!

public sealed class ExtendedCheckBox : CheckBox

Inherits from / implements: CheckBox

Remarks

The Suite comprises of two controls - A extended version of CheckBox and an extended version of RadioButton .NET controls.
ExtendedCheckBox class implements various extended GUI features to the standard .NET framework CheckBox control, by overriding many of its Window messages and implementing a custom paint routine.

The following are the major extended GUI features provided by ExtendedCheckBox .NET control: -
1. Custom control painting - The control supports painting itself using a user specified color. By default, the control draws its Checkbox and the "Check" mark using the Black color value.
When you want the control to paint its "CheckBox" rectangle and the "Check" mark using a color of your choice, you can set the control's property NormalControlColor to a Color value of your choice.
Once set with this value, the control paints itself with this color value whenever it is not in input focus.
The control also lets you decide the color for painting its background. (Refer ControlBackColor for more details)
When the control has the input focus or whenever the mouse hovers over the control, the control paints itself using the Highlight color value.
This color too can be changed by the user by setting its OnFocusControlColor property with a user specified color.
2. Mouse hovering effects - Whenever the control has the input focus, or whenever the mouse focus moves over and out of the control, the control's paints itself using a user-specified color value (OnFocusControlColor).
By default, on mouse hover or on getting the input focus, the control paints itself using the Highlight color value.

Members at a glance

ExtendedCheckBoxConstructs a blank instance of ExtendedCheckBox class.
ControlBackColorGets or sets the custom painting color for drawing the BinaryCheckButton background color.
FlatStyleGets or sets the FlatStyle for the control.
NormalControlColorGets or sets the Painting color when ExtendedCheckBox control remains in a normal (non-focus) mode.
OnFocusControlColorGets or sets the Painting color when ExtendedCheckBox control remains in a "focus" mode.
GetPreferredSizeReturns the size the control would like to be, for the glyph and text it carries.
OnGotFocus
OnLostFocus
OnMouseEnterRaises the MouseEnter event. ExtendedCheckBox overrides it so the control's own handling runs alongside the base behavior.
OnMouseLeave
OnPaintPaints the control: its glyph, its text, and the focus cue.
WndProc

Constructors

ExtendedCheckBox

public ExtendedCheckBox()

Constructs a blank instance of ExtendedCheckBox class.

Properties

ControlBackColor

public Color ControlBackColor

Gets or sets the custom painting color for drawing the BinaryCheckButton background color.

Value. A Color value.

BinaryCheckButton control has the ability to let the user decide the color with which its background will be painted.
By default, this property is set to Window color value.

FlatStyle

public new FlatStyle FlatStyle

Gets or sets the FlatStyle for the control.

Value. A FlatStyle value.

The control is basically a "flat" control and hence its FlatStyle remains Flat, irrespective of what the user sets.

NormalControlColor

public Color NormalControlColor

Gets or sets the Painting color when ExtendedCheckBox control remains in a normal (non-focus) mode.

Value. A Color value.

ExtendedCheckBox control has the ability to let the user decide the color with which the CheckBox rectangle and the "check" mark will be painted.
There are two sets of states for which you can set the color for the control's painting.
1. When the control is in a "Normal" mode - i.e., when the control remains not in focus.
2. When the control is in "focus" mode - i.e., when the control remain in input focus.
You can set this property when you want a color to be used when the control is in the Normal mode (as in 1 above).

OnFocusControlColor

public Color OnFocusControlColor

Gets or sets the Painting color when ExtendedCheckBox control remains in a "focus" mode.

Value. A Color value.

ExtendedCheckBox control has the ability to let the user decide the color with which the CheckBox rectangle and the "check" mark will be painted.
There are two sets of states for which you can set the color for the control's painting.
1. When the control is in a "Normal" mode - i.e., when the control remains not in focus.
2. When the control is in "focus" mode - i.e., when the control remain in input focus.
You can set this property when you want a color to be used when the control is in "Focus" mode (as in 2 above).

Methods

GetPreferredSize

public override Size GetPreferredSize(Size proposedSize)

Returns the size the control would like to be, for the glyph and text it carries.

proposedSize
The size the layout engine is proposing.

Returns. The preferred size.

Without this an auto-sized control would still reserve room for the base class's fixed glyph, and clip the text by the difference.

OnGotFocus

protected override void OnGotFocus(EventArgs e)

No summary in the source yet.

OnLostFocus

protected override void OnLostFocus(EventArgs e)

No summary in the source yet.

OnMouseEnter

protected override void OnMouseEnter(EventArgs e)

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

e
The data for the event.

OnMouseLeave

protected override void OnMouseLeave(EventArgs e)

No summary in the source yet.

OnPaint

protected override void OnPaint(PaintEventArgs e)

Paints the control: its glyph, its text, and the focus cue.

e
The data for the event.

WndProc

protected override void WndProc(ref Message m)

No summary in the source yet.