Users familiar with VFP know that if the ComboBox object displays multiple columns, the normal selection result will be displayed on the selected item with the content of the first column. However, in the actual system design, multiple fields such as book number, name, author and publisher need to be displayed, and the selected result and the value to be transferred may be any one of them. The implementation method is as follows:
(1) Set the attribute ColumnCount of the ComboBox object to 4; the attribute ColumnCountWidth to 12, 40, 12, 40; the attribute RowSourceType to Field; the attribute RowSource to bookcode, title, writer, publisher.
(2) Set the property BoundColumn of the ComboBox object to 2, indicating that the book name is the content to be displayed.
(3) Set the event Interactive Change Event of the ComboBox object as follows:
This.DisplayValue=This.Value
If you want to store the displayed content in other variables, add the following content:
PublicUnknow_str Unknow_str=This.value