Megosztás a következőn keresztül:


Storing User Choices to a Table Using Option Buttons

While it is not as common, you can use option buttons to get information from a user to be stored in a table by saving the Caption property. If you have a standardized testing application, for example, you could use option buttons to make it possible for a user to choose among multiple choice options A, B, C, or D. You could also use option buttons to indicate gender in an employee table.

To store the Caption property of an option button to a table

  1. Set the Value property of the option button group to an empty string.
  2. Set the Control property of the option button group to a character field in a table.

For example, if the captions of the option buttons in a group are "A", "B", "C", and "D", and the ControlSource of the option button group is a character field, when a user chooses the button with the caption "B", "B" is stored in the field.

To see an example of a multiple-choice test using option buttons

  1. Run Solution.app in the Visual FoxPro \Samples\Solution directory.
  2. In the tree view, click Controls, and then click Options buttons.
  3. Click Present a user with multiple choices.

See Also

Setting Option Button Properties | Application of List Boxes and Drop-Down List Boxes | Using Controls | Controls and Objects | Choosing the Type of Data for a List or Combo Box