Setup a ComboBox List
This exercise describes how to add ComboBoxItems to a ComboBox:
- Click and drag a ComboBox from the Toolbox to the Design Sheet:
- To bind the ComboBox to a field in a dataset, select Set Data Binding from the control drop-down menu:
- To add items to the ComboBox, select Edit Items from the control drop-down menu:
- 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:
- Save your changes and click Run to run the form:
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.
Choose the dataset field to bind to the ComboBox:
The data binding is shown on the ComboBox:
In the Edit Items dialog, click the Add button to add items to the ComboBox List:
The ComboBox displays the ComboBoxItems you have bound to the field in the dataset: