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

Remarks

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

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.

OnClearingViewport()

Called when the Viewport is to be cleared.

OnHandlingHotKey(CommandEventArgs)

Called when the View is handling the user pressing the View's HotKey. Set CommandEventArgs.Handled to true to indicate the event was handled and processing should stop.

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.

ValueChanging

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