# CheckBox

URL: https://docs.wisej.com/api/wisej.web/buttons/wisej.web.checkbox

Version: 4.1
Namespace: **Wisej.Web**

Assembly: **Wisej.Framework** (4.1.0.0)

- Control
- [ButtonBase](/api/wisej.web/buttons/wisej.web.buttonbase)
- [CheckBox](/api/wisej.web/buttons/wisej.web.checkbox)
Represents a check box control.

- C# - VB.NET

```csharp
public class CheckBox : ButtonBase, IReadOnly, IValidation
```

```visual
Public Class CheckBox
    Inherits ButtonBase
    Implements IReadOnly, IValidation
```

## Constructors

### ![Instance member](/img/api/instance.png) CheckBox()

Initializes a new instance of the [CheckBox](/api/wisej.web/buttons/wisej.web.checkbox) class.

### ![Instance member](/img/api/instance.png) CheckBox(text, onCheckedChanged)

Initializes a new instance of the [CheckBox](/api/wisej.web/buttons/wisej.web.checkbox) class.

| Name | Type | Description | **text** | [String](https://docs.microsoft.com/dotnet/api/system.string) | Initial text. | **onCheckedChanged** | [Action<Object, EventArgs>](https://docs.microsoft.com/dotnet/api/system.action-2) | Optional [CheckedChanged](/api/wisej.web/buttons/wisej.web.checkbox#checkedchanged) handler. 

### ![Instance member](/img/api/instance.png) CheckBox(text, location, size, onCheckedChanged)

Initializes a new instance of the [CheckBox](/api/wisej.web/buttons/wisej.web.checkbox) class.

| Name | Type | Description | **text** | [String](https://docs.microsoft.com/dotnet/api/system.string) | Initial text. | **location** | [Point](https://docs.microsoft.com/dotnet/api/system.drawing.point) | Initial location. | **size** | [Size](https://docs.microsoft.com/dotnet/api/system.drawing.size) | Initial size. | **onCheckedChanged** | [Action<Object, EventArgs>](https://docs.microsoft.com/dotnet/api/system.action-2) | Optional [CheckedChanged](/api/wisej.web/buttons/wisej.web.checkbox#checkedchanged) handler. 

## Properties

### ![Instance member](/img/api/instance.png) Appearance

[Appearance](/api/wisej.web/enumerations/wisej.web.appearance) : Returns or sets the value that determines the appearance of a [CheckBox](/api/wisej.web/buttons/wisej.web.checkbox) control. (Default: `Normal` )

### ![Instance member](/img/api/instance.png) AutoCheck

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean) : Returns or set a value indicating whether the [Checked](/api/wisej.web/buttons/wisej.web.checkbox#checked) or [CheckState](/api/wisej.web/buttons/wisej.web.checkbox#checkstate) values and the [CheckBox](/api/wisej.web/buttons/wisej.web.checkbox) 's appearance are automatically changed when the [CheckBox](/api/wisej.web/buttons/wisej.web.checkbox) is clicked. (Default: `True` )

### ![Instance member](/img/api/instance.png) AutoSize

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean) : Returns or sets a value that indicates whether the control resizes based on its contents. (Default: `True` )

### ![Instance member](/img/api/instance.png) AutoToolTip

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean) : Returns or sets whether a tooltip is displayed when the text extends beyond the size of the control. (Default: `False` )

The auto tooltip is set on the browser using the [title](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/title) attribute managed by the browser, does not use the themed tooltip managed by Wisej.NET.

### ![Instance member](/img/api/instance.png) CheckAlign

[ContentAlignment](https://docs.microsoft.com/dotnet/api/system.drawing.contentalignment) : Returns or sets the horizontal and vertical alignment of the check mark on a [CheckBox](/api/wisej.web/buttons/wisej.web.checkbox) control. (Default: `MiddleLeft` )

### ![Instance member](/img/api/instance.png) Checked

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean) : Returns or set a value indicating whether the [CheckBox](/api/wisej.web/buttons/wisej.web.checkbox) is in the checked state. (Default: `False` )

### ![Instance member](/img/api/instance.png) CheckedForeColor

[Color](https://docs.microsoft.com/dotnet/api/system.drawing.color) : Returns or sets the text color used when the [CheckBox](/api/wisej.web/buttons/wisej.web.checkbox) is checked. (Default: `Color [Empty]` )

### ![Instance member](/img/api/instance.png) CheckState

[CheckState](/api/wisej.web/enumerations/wisej.web.checkstate) : Returns or sets the state of the [CheckBox](/api/wisej.web/buttons/wisej.web.checkbox) . (Default: `Unchecked` )

### ![Protected member](/img/api/protected.png) DefaultSize

[Size](https://docs.microsoft.com/dotnet/api/system.drawing.size) : Returns the default size of the control.

### ![Instance member](/img/api/instance.png) Invalid

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean) : Returns or sets a value that indicates that the control is invalid.

### ![Instance member](/img/api/instance.png) InvalidMessage

[String](https://docs.microsoft.com/dotnet/api/system.string) : Returns or sets the invalid message that is shown in the invalid tooltip. (Default: `""` )

### ![Instance member](/img/api/instance.png) ReadOnly

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean) : Returns or sets whether the control is read-only. (Default: `False` )

### ![Instance member](/img/api/instance.png) TextAlign

[ContentAlignment](https://docs.microsoft.com/dotnet/api/system.drawing.contentalignment) : Returns or sets the alignment of the text on the [CheckBox](/api/wisej.web/buttons/wisej.web.checkbox) control. (Default: `MiddleLeft` )

### ![Instance member](/img/api/instance.png) ThreeState

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean) : Returns or sets whether the [CheckBox](/api/wisej.web/buttons/wisej.web.checkbox) will allow three check states rather than two. (Default: `False` )

## Methods

### ![Protected member](/img/api/protected.png) OnAppearanceChanged(e)

Fires the [AppearanceChanged](/api/wisej.web/buttons/wisej.web.checkbox#appearancechanged) event.

| Parameter | Type | Description | **e** | [EventArgs](https://docs.microsoft.com/dotnet/api/system.eventargs) | A [EventArgs](https://docs.microsoft.com/dotnet/api/system.eventargs) that contains the event data. 

### ![Protected member](/img/api/protected.png) OnCheckedChanged(e)

Fires the [CheckedChanged](/api/wisej.web/buttons/wisej.web.checkbox#checkedchanged) event.

| Parameter | Type | Description | **e** | [EventArgs](https://docs.microsoft.com/dotnet/api/system.eventargs) | A [EventArgs](https://docs.microsoft.com/dotnet/api/system.eventargs) that contains the event data. 

### ![Protected member](/img/api/protected.png) OnCheckStateChanged(e)

Fires the [CheckStateChanged](/api/wisej.web/buttons/wisej.web.checkbox#checkstatechanged) event.

| Parameter | Type | Description | **e** | [EventArgs](https://docs.microsoft.com/dotnet/api/system.eventargs) | A [EventArgs](https://docs.microsoft.com/dotnet/api/system.eventargs) that contains the event data. 

### ![Protected member](/img/api/protected.png) OnClick(e)

Fires the [Click](/api/wisej.web/general/control/#click) event.

| Parameter | Type | Description | **e** | [EventArgs](https://docs.microsoft.com/dotnet/api/system.eventargs) | A [EventArgs](https://docs.microsoft.com/dotnet/api/system.eventargs) that contains the event data. 

### ![Protected member](/img/api/protected.png) OnForeColorChanged(e)

Fires the [ForeColorChanged](/api/wisej.web/general/control/#forecolorchanged) event.

| Parameter | Type | Description | **e** | [EventArgs](https://docs.microsoft.com/dotnet/api/system.eventargs) | A [EventArgs](https://docs.microsoft.com/dotnet/api/system.eventargs) that contains the event data. 

### ![Protected member](/img/api/protected.png) OnReadOnlyChanged(e)

Fires the [ReadOnlyChanged](/api/wisej.web/buttons/wisej.web.checkbox#readonlychanged) event.

| Parameter | Type | Description | **e** | [EventArgs](https://docs.microsoft.com/dotnet/api/system.eventargs) | An [EventArgs](https://docs.microsoft.com/dotnet/api/system.eventargs) that contains the event data. 

### ![Protected member](/img/api/protected.png) OnValidating(e)

Fires the [Validating](/api/wisej.web/general/control/#validating) event.

| Parameter | Type | Description | **e** | [CancelEventArgs](https://docs.microsoft.com/dotnet/api/system.componentmodel.canceleventargs) | A [EventArgs](https://docs.microsoft.com/dotnet/api/system.eventargs) that contains the event data. 

### ![Protected member](/img/api/protected.png) OnWebRender(config)

Renders the client component.

| Parameter | Type | Description | **config** | [Object](https://docs.microsoft.com/dotnet/api/system.object) | Dynamic configuration object. 

### ![Instance member](/img/api/instance.png) PerformClick()

Generates a [Click](/api/wisej.web/general/control/#click) event for a [CheckBox](/api/wisej.web/buttons/wisej.web.checkbox) .

## Events

### ![Instance member](/img/api/instance.png) AppearanceChanged

[EventHandler](https://docs.microsoft.com/dotnet/api/system.eventhandler) Fired when the value of the [Appearance](/api/wisej.web/buttons/wisej.web.checkbox#appearance) property changes.

### ![Instance member](/img/api/instance.png) CheckedChanged

[EventHandler](https://docs.microsoft.com/dotnet/api/system.eventhandler) Fired when the value of the [Checked](/api/wisej.web/buttons/wisej.web.checkbox#checked) property changes.

### ![Instance member](/img/api/instance.png) CheckStateChanged

[EventHandler](https://docs.microsoft.com/dotnet/api/system.eventhandler) Fired when the value of the [CheckState](/api/wisej.web/buttons/wisej.web.checkbox#checkstate) property changes.

### ![Instance member](/img/api/instance.png) ReadOnlyChanged

[EventHandler](https://docs.microsoft.com/dotnet/api/system.eventhandler) Fired when the value of the [ReadOnly](/api/wisej.web/buttons/wisej.web.checkbox#readonly) property has changed.

## Implements

| Name | Description | [IUserData](/api/wisej.web/interfaces/wisej.web.iuserdata) | Provides access to the `UserData` and `Tag` properties associated to the component implementing this interface. | [IBindableComponent](/api/wisej.web/data-binding/wisej.web.ibindablecomponent) | Bindable components implement this interface. | [ICommandSource](/api/wisej.web/interfaces/wisej.web.icommandsource) | Defines an object that can invoke a [Command](/api/wisej.web/interfaces/wisej.web.icommandsource#command) . | [IDropTarget](/api/wisej.web/interfaces/wisej.web.idroptarget) | Controls that support drag & drop operations implement this interface. | [IImage](/api/wisej.web/interfaces/wisej.web.iimage) | Provides access to common image properties across the controls that implement this interface. | [IReadOnly](/api/wisej.web/interfaces/wisej.web.ireadonly) | Provides access to the [ReadOnly](/api/wisej.web/interfaces/wisej.web.ireadonly#readonly) property for coontrols that support the read-only mode. | [IValidation](/api/wisej.web/interfaces/wisej.web.ivalidation) | Provides access to the validation events and properties property for controls that support validation. | [IWisejComponent](/api/wisej.core/interfaces/wisej.core.iwisejcomponent) | All wisej components implement this interface. | [IWisejControl](/api/wisej.core/interfaces/wisej.core.iwisejcontrol) | All wisej controls derived from theControl class must implement this interface. | [IWisejSerializable](/api/wisej.core/interfaces/wisej.core.iwisejserializable) | Allows an object to serialize itself.
