Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Get selected item
Message
De
09/01/2004 08:59:16
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
09/01/2004 08:40:06
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00865405
Message ID:
00865411
Vues:
16
This message has been marked as the solution to the initial question of the thread.
>To get selected items in a ComboBox, I can loop through each element, and check whether .Selected(i) is true.
>
>Is there a shortcut to get the selected element without writing a loop, assuming that .MultiSelect = .F.?
>
>And how about setting the initial value?
>
>As an example, I have a ComboBox to select months, with values "January, February, March...". In this case, I want to a) preset it to the current month, b) Get the user selection as a number (Jan. = 1, Feb. = 2...).
>
>Right now, I have assigned a number (as text) to a second, invisible, column - but I thought there might be a simpler way to do this.
>
>TIA,
>
>Hilmar.

ListIndex.

To be more clear :

myList.ListIndex = 4 && Sets initial selection to 4th item
myList.ListIndex = month(Date())

* Get selected month number
lnMonth = myList.ListIndex && You would store just Cmonth()
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform