Setup a ComboBox List

This exercise describes how to add ComboBoxItems to a ComboBox:

  1. Click and drag a ComboBox from the Toolbox to the Design Sheet:
  2. Resize

    Click and drag the corners of the control to resize the control.

    Reposition

    Click and drag the handle (top-left) to reposition the control.

  3. To bind the ComboBox to a field in a dataset, select Set Data Binding from the control drop-down menu:
  4. Choose the dataset field to bind to the ComboBox:

    The data binding is shown on the ComboBox:

  5. To add items to the ComboBox, select Edit Items from the control drop-down menu:
  6. In the Edit Items dialog, click the Add button to add items to the ComboBox List:

  7. The next step is to bind the ComboBoxItems to a list of values from the bound dataset. Select Set List Binding from the control drop-down menu:
  8. Save your changes and click Run to run the form:
  9. The ComboBox displays the ComboBoxItems you have bound to the field in the dataset: