Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Checkbox - don't want ENTER to change value
Message
From
22/12/1999 09:47:45
Charlie Schreiner
Myers and Stauffer Consulting
Topeka, Kansas, United States
 
 
To
21/12/1999 20:37:09
Bill Totten
William Totten & Associates, Inc.
Indiana, United States
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00307053
Message ID:
00307276
Views:
13
>I would like to override (disable) the default behaviour on a CHECKBOX when the user presses ENTER and if toggles the VALUE. Ideas please ....
>
>TIA,
>Bill

Here's a way you might handle it.
The InterActiveChange could be done through ProgrammaticChange, of course, but it seems to better fit here--InteractiveChange normally fires when the user types.

#DEFINE ENTERKEY 13
LPARAMETERS nKeyCode, nShiftAltCtrl
DO CASE
CASE nKeyCode = ENTERKEY
   NODEFAULT
   KEYBOARD "{TAB}"
CASE INLIST(m.nKeyCode, 88, 120, 116, 84, 121, 89)
   * User typed x, X, T, or t.
   IF NOT THIS.Value
      THIS.Value = .T.
      THIS.InterActiveChange() && Depending on your ProgrammaticChange code.
   ENDIF
   NODEFAULT
CASE INLIST(m.nKeyCode, 102,70, 78, 110)
   * User typed F, f, n, or N.
   IF THIS.Value 
      THIS.Value = .F.
      THIS.InterActiveChange()
   ENDIF
   NODEFAULT
OTHERWISE
ENDCASE
Charlie
Previous
Reply
Map
View

Click here to load this message in the networking platform