Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Fun with Combos...
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00798666
Message ID:
00798807
Views:
25
This message has been marked as the solution to the initial question of the thread.
Hello Wayne.

Tell me why this is doing what it is doing?

The combo based on the character is fine, the one based on the number is getting the ordinal item from the array.


You need to set the Combo's BoundTo property to true. Actually, I think that this is one that should be true by default.

The setting of BoundTo specifies whether the value property of a combo or list box is determined by its List or its ListIndex property. The setting of BoundTo only matters when the control is bound to a numeric data source. If the ControlSource of the combo or list box refers to numeric data, setting the control's BoundTo property to true tells Visual FoxPro to update the ControlSource using the data from the bound column of the control's internal list. Leaving BoundTo set to false here causes the ControlSource to be updated with the control's ListIndex, that is, the row number of the currently selected item.

The easiest way to illustrate how this works is by using a little code that simulates how the setting of the BoundTo property affects the way in which the control’s Value property is updated:
WITH This
  IF .BoundTo
    .Value = VAL( .List[.ListIndex, .BoundColumn] )
  ELSE
    .Value = .ListIndex
  ENDIF
ENDIF
Previous
Reply
Map
View

Click here to load this message in the networking platform