Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ComboBox In Grid
Message
De
05/10/2001 18:43:48
 
 
À
05/10/2001 07:02:32
Lakhani Anil
Lakhani Software Solutions
Mumbai, Inde
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00564668
Message ID:
00565038
Vues:
26
Hi Anil.

>> I am using combobox in Grid, but I wants that when user press up/down arrow, Combobox's value shouldn't be changed. Instead it should navigate in Grid for next/previous record. <<

What you need to do is to create a special combo class to do the job. You add a property called lDroppedDown to the combo and set it to true in the combo's DropDown event. You set it to false in the click event and in the keypress event if the user has pressed wither the escape or the enter keys.

Add a method called handleKey to your combo and call it from the combo's keyPress when combo.lDroppedDown = .F.. Handle key basically has to activate the cell in the grid's ActiveColumn at .RelativeRow + 1.

FWIW, there is a working class that does this in chapter 6 of "1001 Things You Wanted to Know About Visual FoxPro" (Akins, Kramek, Schummer - Hentzenwerke publishing May 2000). But I have given you enough to get you started if you want to roll your own. It really is not that difficult.

You may also want to check FoxPro Advisor from February, 2000 for an article I wrote called “Spice Up Your Grid With a Combo”. It gives you all the source code you need to do this. You can order back issues at www.Advisor.com.

HTH

Marcia
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform