Thanks, Bonnie. This looks very simple. I should be able to put this in my subclassed business form, right?
>Linda,
>
>You'll have to override the Form's ProcessCmdKey() method. If you haven't done this before, the code should look something like this:
>
>
>protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
>{
> const int WM_KEYDOWN = 0x100;
> const int WM_SYSKEYDOWN = 0x104;
>
> if ((msg.Msg == WM_KEYDOWN) || (msg.Msg == WM_SYSKEYDOWN))
> {
> // "eat" any key that is not a space, as if it were never pressed
> if (ActiveControl is CheckBox && keyData != Keys.Space)
> return true;
> }
>
> return base.ProcessCmdKey(ref msg, keyData);
>}
>
>
>~~Bonnie
>
>
>
>>A user noted that when a checkbox control has focus and a letter for one of the hot keys is pressed (e.g., D for the delete button), the hot key fires without requiring Alt+D to be pressed.
>>Now I realize that the user should not be pressing anything besides Enter or Space when on a checkbox control but . . .
>>Does anyone have any suggestions other than 1) setting the tabstop property to false; 2) eliminating the hot keys; 3) training the users?
>>Thanks.
Linda Harmes
HiBit Technologies, Inc.