Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Difference in clicking
Message
De
15/02/2016 10:28:59
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Allemagne
 
 
À
15/02/2016 09:55:46
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 7
OS:
Windows 7
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01631466
Message ID:
01631477
Vues:
53
>There appears to be a difference in physically clicking a button with the mouse, and doing it programmatically, as in thisform.thatbutton.click. Can anyone please explain this to me?
>
>I have a textbox that a search string is typed into. To make it more convenient for the user, so they don't have to actually use the mouse, I have the following in the KeyPress method:
>
>IF nKeyCode=13 &&the 'enter' key
>	thisform._searchcmd.Click
>ENDIF
>
>
>The code in thisform._searchcmd.click is accessed, and run, but the cursor holding the SQL Select(ed) data is empty. Physically click the _searchcmd button, and the data is there...
>
>Thanks.

The simplest way to bound enter to some button is to make button DEFAULT.

That shows up that ENTER is special on UI, one expects the dialoge to accept data and close. In opposite to ESC - reject data and close. The Cancel property is used for this.

So for you, use the textbox events GOTFOCUS und LOSTFOCUS (or there delegates as others suggest, that's your taste) to set thisform._searchcmd.DEFAULT true and false.

No keypress needed.
Words are given to man to enable him to conceal his true feelings.
Charles Maurice de Talleyrand-Périgord

Weeks of programming can save you hours of planning.

Off

There is no place like [::1]
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform