How can I tell if a CHECKBOX contains focus. We have a specific set of keyboard requirements that if the user clicks the "ENTER" key, the next control should bet set focused, but not change the state of the checkbox. Clicking the "ENTER" key does change the state. When you are on a CheckBox, ContainsFocus doesn't seem to work. So, what we would like to do, is if the CHECKBOX has focus, when the use clicks the "ENTER" key, it just moves to the next control in a tab order and not check the checkbox. (We are trying to get the DateTimePicker to do the same thing)...
protected virtual void HandleKeyDownForForm(object sender, KeyEventArgs e)
{
if (e.KeyData == Keys.Enter)
{
if (ntsRadDateTimePickerDob.ContainsFocus)
{
_dobHasNullValue = !ntsRadDateTimePickerDob.NullableValue.HasValue;
}
if (radCheckBoxActiveAbsentee.ContainsFocus)
{
_activeAbsenteeValue = radCheckBoxActiveAbsentee.IsChecked;
}
Control ctl = (Control)sender;
ctl.SelectNextControl(ActiveControl, true, true, true, true);
}
}
Any help would be greatly appreciated.
Thank You.