CheckBoxAdv Events in Windows Forms CheckBox (CheckBoxAdv)

26 Apr 2021 / 1 minute to read

This section gives detailed explanation about the CheckStateChanged and CheckedChanged events in CheckBoxAdv control.

CheckBoxAdv Events Description
CheckStateChanged This event occurs when the CheckState property is changed.
CheckedChanged This event is raised when the Checked property is changed.

CheckStateChanged Event

This event is raised when the CheckState property of CheckBoxAdv is changed and the event handler receives an argument of type EventArgs containing data related to this event.

private void checkBoxAdv1_CheckStateChanged(object sender, EventArgs e)
    Console.WriteLine(" CheckStateChanged event is raised");
Private Sub checkBoxAdv1_CheckStateChanged(ByVal sender As Object, ByVal e As EventArgs)
Console.WriteLine(" CheckStateChanged event is raised")
End Sub

CheckedChanged Event

This event is raised when the Checked property is changed and this property changes automatically when the CheckState property is changed.

private void checkBoxAdv1_CheckedChanged(object sender, EventArgs e)
    if (!checkBoxAdv1.Checked)
        MessageBox.Show("Checkbox Unchecked");
        MessageBox.Show("Checkbox checked");
Private Sub checkBoxAdv1_CheckedChanged(ByVal sender As Object, ByVal e As EventArgs)
If Not checkBoxAdv1.Checked Then
MessageBox.Show("Checkbox checked”)
MessageBox.Show("Checkbox checked)
End If
End Sub