Table of Contents

Class CheckBox

Namespace
Terminal.Gui.Views
Assembly
Terminal.Gui.dll

Shows a checkbox that can be cycled between two or three states.

public class CheckBox : View, IDisposable, ISupportInitializeNotification, ISupportInitialize, IValue<CheckState>, IValue
Inheritance
CheckBox
Implements
Inherited Members
Extension Methods

Remarks

RadioStyle is used to display radio button style glyphs (●) instead of checkbox style glyphs (☑).

Default mouse bindings:

Mouse EventAction
ClickToggles the checked state (Activate).
Double-ClickAccepts the checkbox (Accept).

Constructors

CheckBox()

Initializes a new instance of CheckBox.

Properties

AllowCheckStateNone

If true allows Value to be None. The default is false.

DefaultMouseHighlightStates

Gets or sets the default Highlight Style.

HotKeySpecifier

Gets or sets the specifier character for the hot key (e.g. '_'). Set to '\xffff' to disable automatic hot key setting support for this View instance. The default is '\xffff'.

RadioStyle

If true, the CheckBox will display radio button style glyphs (●) instead of checkbox style glyphs (☑).

Text

The text displayed by the View.

Value

Gets or sets the state of the CheckBox.

Methods

AdvanceCheckState()

Advances Value to the next value. Invokes the cancelable ValueChanging event.

OnActivated(ICommandContext?)

Called when the View has been activated. This is called after Accepting has been raised and not cancelled.

OnClearingViewport()

Called when the Viewport is to be cleared.

OnValueChanged(ValueChangedEventArgs<CheckState>)

Called when the CheckBox Value has changed.

OnValueChanging(ValueChangingEventArgs<CheckState>)

Called when the CheckBox Value is changing.

UpdateTextFormatterText()

Can be overridden if the Text has different format than the default.

Events

ValueChanged

Raised when Value has changed.

ValueChangedUntyped

Raised when Value has changed, providing the value as an un-typed object.

ValueChanging

Raised when Value is about to change. Set Handled to true to cancel the change.