>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