Columns, ColumnCount
These properties provide access to the columns in a grid. ColumnCount tells how many there are and Columns lets you actually touch the individual columns.ColumnCount also applies to combo boxes and list boxes, where it tells how many columns are displayed in the list or combo, but lists and combos don't have a matching Columns collection. (Use the List or ListItem collection instead.)
Usage |
colColumn = grdGrid.Columns( nColumnNumber ) oObject.ColumnCount = nNumberOfColumns nNumberOfColumns = oObject.ColumnCount |
On the other hand, lists and combos with a RowSourceType of 7-Files should ignore ColumnCount and don't. With ColumnCount more than 1, you end up with multiple, identical columns. Be sure to set ColumnCount to 1 or the default, 0, if you use this RowSourceType. (Of course, there are better ways to let the user choose a file, including the Common Dialogs control, so we sure don't plan to use a lot of lists and combos with RowSourceType = 7.) |
Example |
* Set up a multi-column list box. Assume we're in the * Init of the list. This.ColumnCount = 3 This.ColumnWidths = "100,100,100" This.RowSourceType = 2 && Alias This.RowSource = "Customer" |
See Also |
ColumnOrder, ColumnWidths, List Property, ListItem, RowSource, RowSourceType |