I want to use Enter key instead of Space key to check the checkboxes..
private void Form2_KeyDown(object sender, KeyEventArgs e)
{
CheckBox c1 = this.ActiveControl as CheckBox;
if (e.KeyData == Keys.Enter && this.ActiveControl.Equals(c1))
c1.Checked = true;
}
I could do it if i write this code in the KyeUp of the checkbox, but the thing is, I have several Checkboxes in the form and I cant write this under each of their KeyUp, so I need to use it under the KeyUp of the form.. What do I need to change??