---
id: "T:cAlgo.API.CheckBoxEventArgs"
kind: "class"
namespace: "cAlgo.API"
url: "https://help.ctrader.com/ctrader-algo/references/EventArgs/CheckBoxEventArgs/"
---

> Documentation index for agents: https://help.ctrader.com/ctrader-algo/llms.txt · machine index: https://help.ctrader.com/ctrader-algo/api.json

# CheckBoxEventArgs (class)

Provides data for the checkbox event.

Environments: Desktop supported · CLI not supported · Cloud not supported.

- CLI: Never raised in the CLI: the events that pass it never fire there (CheckBox.Checked, CheckBox.Click, CheckBox.Indeterminate and more).
- Cloud: Never raised in the cloud: the events that pass it never fire there (CheckBox.Checked, CheckBox.Click, CheckBox.Indeterminate and more).

## Definition

```csharp
public class CheckBoxEventArgs
```

## Examples

C#:

```csharp
using cAlgo.API;

namespace cAlgo
{
    // This example shows how to use the CheckBoxEventArgs
    public partial class CheckBoxEventArgsSample : Indicator
    {
        protected override void Initialize()
        {
            var checkBox = new CheckBox
            {
                Text = "Check Box",
                HorizontalAlignment = HorizontalAlignment.Center,
                VerticalAlignment = VerticalAlignment.Center,
            };

            checkBox.Click += CheckBox_Click;

            Chart.AddControl(checkBox);
        }

        private void CheckBox_Click(CheckBoxEventArgs obj)
        {
            var state = obj.CheckBox.IsChecked.Value ? "Checked" : "Unchecked";

            obj.CheckBox.Text = state;
        }

        public override void Calculate(int index)
        {
        }
    }
}
```

Python:

```python
import clr
clr.AddReference("cAlgo.API")

from cAlgo.API import *

class Test():
    def initialize(self):
        checkBox = CheckBox()
        checkBox.Text = "Check Box"
        checkBox.HorizontalAlignment = HorizontalAlignment.Center
        checkBox.VerticalAlignment = VerticalAlignment.Center

        checkBox.Click += self.on_check_box_click

        api.Chart.AddControl(checkBox)

    def on_check_box_click(self, args):
        state = "Checked" if args.CheckBox.IsChecked else "Unchecked"
        args.CheckBox.Text = state
```

config.json:

```json
{
  "AccessRights": "None",
  "TimeZone": "UTC",
  "IsOverlay": true
}
```

## Properties

- `public CheckBox CheckBox {get;}` — Gets the checkbox data. [details](https://help.ctrader.com/ctrader-algo/references/EventArgs/CheckBoxEventArgs/CheckBox/index.md)

