Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Combo box default selected item
Message
From
09/08/2001 15:56:57
 
 
To
09/08/2001 15:45:28
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00541586
Message ID:
00541979
Views:
17
Actually, what we really wanted was to avoid writing any code. We simply wanted to set a property. It turns out using Value as our RowSourceType and simpy setting the Value property to the number (index) of the value you want to show first is all we really had to do.

>Dan,
>
>I may be missing something, here, but if all you want to do is highlight a particular item in the list, then after you create the array and requery() to update the list, set ListItemID to the number of the item you want to select.
>
>
>WITH thisform.myCombobox
>     * Add the array rowsource
>     .AddProperty( "aRowSource[ 2 ]" )
>
>     .RowSource = "this.aRowSource"
>     .RowSourceType = 5
>
>     * Populate the array
>     .aRowSource[ 1 ] = "Yes"
>     .aRowSource[ 2 ] = "No"
>
>     * Populate the list from the array.
>     .Requery()
>
>     .ListItemID = 2 --> "No" is highlighted and selected.
>
>ENDWITH
>
>Regards,
Previous
Reply
Map
View

Click here to load this message in the networking platform