Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Moving to first row in grid
Message
 
À
13/04/2001 17:57:44
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00495466
Message ID:
00495473
Vues:
10
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.

Hope this helps...

--Brad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform