Using DATALISTs and COMBOBOXes


 

DATALISTs and COMBOBOXes present a list of choices to the user. By default, the choices are displayed vertically in a single column, although you can set up multiple columns as well. If the number of items exceeds what can be displayed in the COMBOBOX or DATALIST, scroll bars automatically appear on the control. The user can then scroll up and down or left to right through the list.

 

A COMBOBOX control combines the features of a text box and a list box. This control allows the user to select either by typing text into the combo box or by selecting an item from its list.

 

In contrast to some other controls that contain a single value; for example the STATTEXT's Caption property or the EDITTEXT's Text property, DATALISTs and COMBOBOXes contain multiple values or a collection of values. They have built-in methods for adding, removing and retrieving values from their collections at run time. To add several items to a DATALIST named List1, the code would look like this:

 

     List1.AddString USING "Paris"

     List1.AddString USING "New York"

     List1.AddString "San Francisco"

 

DATALISTs and COMBOBOXes are an effective way to present a large number of choices to the user in a limited amount of space.



PL/B IDE Studio Help Grouping Options with Option Buttons Using Scrollbars as Input Devices