DISPLAY-COLUMNS (numeric)

This property describes where each DATA-COLUMN will display in the list box. The first column always displays in column 1. Additional columns display at the locations set by DISPLAY-COLUMNS. Columns are measured with the standard font measure (that is, the width of the character 0 in the list box's font). Each time you set DISPLAY-COLUMNS to a positive value, a new display column is defined. Setting DISPLAY-COLUMNS to 0 clears all of the columns (except column 1).

If you are using a proportionally spaced font, you should provide enough space in each column to allow for wider-than-average data. You will also want to provide some white space between columns. For example, you might code the following:

DATA-COLUMNS = ( 21, 36 )
DISPLAY-COLUMNS = ( 31, 51 )

In this example, the first column, which is 30 characters wide in the display, accommodates a 20-character data source, and the second column, which is 20 characters wide, accommodates a 15-character data source.

The maximum number of columns you can set is 30. Any columns over 30 will be ignored by the runtime and will not display.

Data contained in a column cannot overflow the allocated space. If the data is too large to be fully displayed, the data is truncated. Therefore, you should always set your columns wide enough to hold the largest data item.

Note: You can also use columns to hide data. A column set beyond the right side of the list box is not visible on the screen. You can use this behavior to store information in the list box that your program needs to associate with list items, but that you don't want to be seen by the user. One potential use for this feature is to store a file record's primary key value in the hidden column so that you can retrieve the full record easily when the user selects an item in the list.