Multicolumn List Boxes in Microsoft WindowsLast reviewed: November 2, 1995Article ID: Q64504 |
The information in this article applies to:
SUMMARYIn the Microsoft Windows environment, a multicolumn list box is designed to contain homogeneous data. For example, all the data might be "first names." These first names could logically fall into the same column or be in multiple columns. This feature was added to Windows at version 3.0 to enable a list box to be shorter vertically by splitting the data into two or three columns.
MORE INFORMATIONTo create a multicolumn list box, specify the LBS_MULTICOLUMN style when creating the list box. Then the application calls the SendMessage function to send an LB_SETCOLUMNWIDTH message to the list box to set the column width. When an application sends an LB_SETCOLUMNWIDTH message to a multicolumn list box, Windows does not update the horizontal scroll bar until the a string is added to or deleted from the list box. An application can work around this situation by performing the following six steps when the column width changes:
Windows automatically manages the list box, including horizontal and vertical scrolling and distributing the entries into columns. The distribution is dependent on the dimensions of the list box. Windows fills Column 1 first, then Column 2, and so on. For example, if an application has a list box containing 13 ordered items and vertical space for 5 items, items 1-5 would be in the first column, items 5-10 in the second, and 11-13 in the last column, and item order would be maintained. A multicolumn list box cannot have variable column widths.
|
Additional reference words: 3.00 3.10 3.50 3.51 4.00 95
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |