Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Change Checkbox behaviour
Message
De
08/08/2006 09:52:34
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
08/08/2006 09:48:04
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01142907
Message ID:
01143774
Vues:
7
>>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

Stuart,
I think it'd be better to check baseclass instead.
.. lower(this.activecontrol.baseclass) == "checkbox"
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform