Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Change Checkbox behaviour
Message
From
08/08/2006 09:48:04
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01142907
Message ID:
01143772
Views:
11
>My clients press ENTER to navigate through a form. Checkbox causes a problem here,
> as it's value changes on pressing ENTER key. I will need to use Y/N textbox instead.
> I have not subclasses the checkbox and it has already been implemented in the project.

Behold the wonders of subclassing!

>Is there a way to change the behaviour of Checkbox all over the project in one go?

You can do it at a form level:
1) Set each form's KeyPreview property to True.
2) add this code to each form's KeyPress event:

lparameters nKeyCode, nShiftAltCtrl
if nKeyCode = 13 and this.activecontrol.class = "Checkbox"
* Suppress enter's default behaviour..
nodefault
* .. but move to next control
keyboard '{tab}' plain
endif
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform