Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Best way to set default value for combobox?
Message
From
11/10/2000 15:58:06
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00427909
Message ID:
00428048
Views:
19
>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.

You'd have to include an empty member of the row source.
e.g.,
WITH thisform
  DIMENSION .aRow(3)
  .aRow[1] = ""
  .aRow[2] = "hello"
  .aRow[3] = "world"
  .cboCombo.RowSourceType = 5
  .cboCombo.RowSource = "thisform.aRow"
  .cboCombo.Requery()

** or
  .cboCombo.RowSourceType = 1
  .cboCombo.RowSource = ",hello,world"
  .cboCombo.Requery()

ENDWITH
Insanity: Doing the same thing over and over and expecting different results.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform