Why do you want to create a click event on a CheckBox?
If you want to switch its value:
theCheckBox.Checked = !theCheckBox.Checked;
If you want to call some functions associated with the Click event, it is better to translate the code from the Click event handler into a separate method that can be called from anywhere:
private void theCheckBox_Click(object sender, EventArgs e) { HandleCheckBoxClick((CheckBox)sender); } private void HandleCheckBoxClick(CheckBox sender) {
When you create your code this way, you can easily call functionality from anywhere:
HandleCheckBoxClick(theCheckBox);
The same approach can (and perhaps should) be used for most control event handlers; move as much code as possible from event handlers and to methods that are more reused.
source share