Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Moving to first row in grid
Message
De
15/04/2001 16:21:51
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00495466
Message ID:
00495664
Vues:
14
>According to the help file, KeyPress won't occur for any combination of keys with the ALT key, so let's use CTRL+HOME instead.
>
>In the KeyPress method of the textbox of every column in your grid, put the following code:
>
>
>LPARAMETERS nKeyCode, nShiftAltCtrl
>if nkeycode=29  and nshiftaltctrl=2  &&CTRL+HOME
>  this.parent.parent.column1.text1.setfocus()
>  nodefault
>endif
>
>
>But personally I hate duplication of code, so I'd build a grid class, where every textbox has KeyPress code that simply calls a common grid method (called CommonKeyPress or some such) and have that do the setfocus and other behaviors if desired. That way you only have to change the code in one place if you want to tweak it.

Brad,

Ctrl+Home standard behaviour is to move to first row.
Can you recommend some other key ?

Why not to use form keypreview property? This eliminates the need to
add custom class to grid.
Andrus
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform