Show / Hide Table of Contents

# Class CheckBox

The Checkbox View shows an on/off toggle that the user can set

##### Inheritance

System.Object
Responder
View
CheckBox

##### Inherited Members

Responder.CanFocus
View.Add(View)
View.Add(View[])
View.AddRune(Int32, Int32, Rune)
View.Bounds
View.ChildNeedsDisplay()
View.Clear()
View.Clear(Rect)
View.ClearNeedsDisplay()
View.ClipToBounds()
View.ColorScheme
View.DrawFrame(Rect, Int32, Boolean)
View.DrawHotString(ustring, Boolean, ColorScheme)
View.DrawHotString(ustring, Attribute, Attribute)
View.Driver
View.EnsureFocus()
View.Focused
View.FocusFirst()
View.FocusLast()
View.FocusNext()
View.FocusPrev()
View.Frame
View.GetEnumerator()
View.HasFocus
View.Height
View.Id
View.LayoutStyle
View.LayoutSubviews()
View.MostFocused
View.Move(Int32, Int32)
View.ProcessColdKey(KeyEvent)
View.ProcessHotKey(KeyEvent)
View.Remove(View)
View.RemoveAll()
View.ScreenToView(Int32, Int32)
View.SetClip(Rect)
View.SetFocus(View)
View.SetNeedsDisplay()
View.SetNeedsDisplay(Rect)
View.Subviews
View.SuperView
View.ToString()
View.WantMousePositionReports
View.Width
View.X
View.Y

###### Namespace: Terminal.Gui

###### Assembly: Terminal.Gui.dll

##### Syntax

    public class CheckBox : Terminal.Gui.View

### Constructors

#### CheckBox(ustring, Boolean)

Public constructor, creates a CheckButton based on the given text, uses Computed layout and sets the height and width.

##### Declaration

    public CheckBox (NStack.ustring s, bool is_checked = false);

##### Parameters

Type | Name | Description
--- | --- | ---
NStack.ustring | s | S.
System.Boolean | is_checked | If set to `true` is checked.

#### CheckBox(Int32, Int32, ustring)

Public constructor, creates a CheckButton based on the given text at an absolute position.

##### Declaration

    public CheckBox (int x, int y, NStack.ustring s);

##### Parameters

Type | Name | Description
--- | --- | ---
System.Int32 | x | To be added.
System.Int32 | y | To be added.
NStack.ustring | s | To be added.

##### Remarks

The size of CheckButton is computed based on the text length. This CheckButton is not toggled.

#### CheckBox(Int32, Int32, ustring, Boolean)

Public constructor, creates a CheckButton based on the given text at the given position and a state.

##### Declaration

    public CheckBox (int x, int y, NStack.ustring s, bool is_checked);

##### Parameters

Type | Name | Description
--- | --- | ---
System.Int32 | x | To be added.
System.Int32 | y | To be added.
NStack.ustring | s | To be added.
System.Boolean | is_checked | To be added.

##### Remarks

The size of CheckButton is computed based on the text length.

### Properties

#### Checked

The state of the checkbox.

##### Declaration

    public bool Checked { get; set; }

##### Property Value

Type | Description
--- | ---
System.Boolean | To be added.

#### Text

The text displayed by this widget.

##### Declaration

    public NStack.ustring Text { get; set; }

##### Property Value

Type | Description
--- | ---
NStack.ustring | To be added.

### Methods

#### MouseEvent(MouseEvent)

##### Declaration

    public override bool MouseEvent (Terminal.Gui.MouseEvent me);

##### Parameters

Type | Name | Description
--- | --- | ---
MouseEvent | me | To be added.

##### Returns

Type | Description
--- | ---
System.Boolean | To be added.

#### PositionCursor()

##### Declaration

    public override void PositionCursor ();

#### ProcessKey(KeyEvent)

##### Declaration

    public override bool ProcessKey (Terminal.Gui.KeyEvent kb);

##### Parameters

Type | Name | Description
--- | --- | ---
KeyEvent | kb | To be added.

##### Returns

Type | Description
--- | ---
System.Boolean | To be added.

#### Redraw(Rect)

##### Declaration

    public override void Redraw (Terminal.Gui.Rect region);

##### Parameters

Type | Name | Description
--- | --- | ---
Rect | region | To be added.

### Events

#### Toggled

Toggled event, raised when the CheckButton is toggled.

##### Declaration

    public event EventHandler Toggled;

##### Event Type

Type | Description
--- | ---
System.EventHandler | To be added.

##### Remarks

Client code can hook up to this event, it is raised when the checkbutton is activated either with the mouse or the keyboard.