This property was one of the most welcome additions to VFP 5. It lets you indicate whether a numeric ControlSource for a combo or list contains the position of the selected item or the value of the item.
lBindToNumericValue = oObject.BoundToThe Value of combos and lists in Visual FoxPro can be either numeric or character. When the Value of a list or combo is initialized to a number or the ControlSource is numeric, by default, the position (Index) of the chosen item is stored. Even if the BoundColumn contains numeric data, it's the Index that gets stored.
However, lists and combos have the ability to draw their Value from a different field than the first one displayed and, in fact, to draw their Value from a column that isn't even displayed. This makes it possible to display a list of items, but store the unique IDs of those items. If you're using numeric (say, Integer) IDs, though, the default behavior of lists and combos presents a problem.
Enter BoundTo. If this property is set to .T., the actual numeric data is stored if both Value/ControlSource and the column referenced by BoundColumn are numeric. Leave BoundTo at .F. and you get the Index. If the column referenced by BoundColumn isn't numeric, but Value/ControlSource are, the Index is stored. If Value/ControlSource are character, then the content of the bound column is stored, as usual.
Note that you have to make up your mind ahead of time on this one. It's read-only at runtime.
oForm = CREATEOBJECT("Form")
* Add a list with character data in the first column
* and numeric in the second, which is the bound column.
OForm.AddObject("lstTwoCol","ListBox")
WITH oForm.lstTwoCol
.Visible = .T.
.RowSourceType = 1 && Value
.RowSource = "Fred,17,Ethel,31,Lucy,2,Ricky,49"
.ColumnCount = 2
.ColumnWidths = "50,30"
.BoundColumn = 2
.BoundTo = .T. && Treat column 2 as numbers.
ENDWITH
oForm.Show()