Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Best way to set default value for combobox?
Message
 
 
To
11/10/2000 15:06:40
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00427909
Message ID:
00428045
Views:
23
>>Hello Trey,
>>
>>I had THISFORM.combobox.Value = "County" in my Form Init, but it's not getting into the form. And I have THISFORM.Refresh at the end of the Form Init code.
>>And "County1" is one of the values in RowSource as in County1, County2, County3.
>>
>>I wonder why it's not working? I have textbox default value set similarly and it works. Maybe there's something in one of the combobox properties that's messing it up. I will have to look again.
>>
>>Thanks.
>
>You could also try
>
>this.combobox.ListIndex = 1

Yes, this is the solution, which should work, I believe. I wanted to suggest it also. Also we can play with combobox.displayvalue

BTW, another question, related with combobox:
If you have a combobox, which is dropdown list, after you make your selection, how can you return to default (empty state)?
Suppose, you have a field in your main table, which may contain a coded value or could be empty. For this field you use a combobox (drop down list). Suppose, you choose something. How then could you return it back to empty state? Seems there is no way, unless you would code some event to do so, say, Right Click.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform