Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Anyone remember '@M'?
Message
De
20/07/1999 14:49:16
 
 
À
20/07/1999 12:00:54
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00243627
Message ID:
00243712
Vues:
27
Hi John.

Where are your options coming from? And what version of VFP?

I'll assume from a list of values and VFP5 for now...Anyway, set the Value at design time to the first item (for the example, items are Apples, Oranges, and Bananas). The following code goes into the KeyPress event of the Textbox:
LPARAMETERS nKeyCode, nShiftAltCtrl
IF nKeyCode=32 && Spacebar, just like the old @M
   DO CASE
   CASE THIS.Value="Apples"
      THIS.Value="Oranges"
   CASE THIS.Value="Oranges"
      THIS.Value="Bananas"
   CASE THIS.Value="Bananas"
      THIS.Value="Apples"
   ENDCASE
ENDIF
NODEFAULT
If the source of the items is a table, do a SKIP on the table until EOF then go top and set the Value to the appropriate field.

>Hey FoxFolx -
>We used to be able to have a pre-determined list of options in a text box by using the PICTURE clause with '@M Option1,Option2,Option3'. I can't seem to figure out how to do it with VFP Text Controls.
>
>I know I could use a Drop Down, but the real estate is very cramped. Is this still possible with VFP?
>
>Thanks in advance!
>
>- John Kiernan
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform