Click to Rate and Give Feedback
MSDN
MSDN Library
Collapse All/Expand All Collapse All
This page is specific to
Microsoft Visual Studio 2008/.NET Framework 3.5

Other versions are also available for the following:
Visual FoxPro 9.0 SP2
ColumnCount Property (Visual FoxPro)

Specifies the number of Column objects in a Grid, ComboBox, or ListBox control. For a grid, available at design time and read/write at run time. For a combo box or list box, available at design time and run time.

Object.ColumnCount[ = nCol]
nCol

For a Grid control, specifies the number of columns to display. The default is –1, which specifies that the Grid control should contain enough columns to accommodate all the fields in the grid's record source. The maximum number of columns is 255. If you create a specific number of columns by setting nCol to a positive value, specify the data to display in a particular column by setting that column's ControlSource property. (If ControlSource is not specified for a column, the Grid control displays the next available undisplayed field of the grid's record source.)

For a ComboBox or ListBox control, nCol specifies the number of columns the control contains. If you set ColumnCount to 0, the first column is displayed based on the RowSource property or on the items added with the AddItem method.

Applies To: ComboBox Control | Grid Control | ListBox Control

For a grid, use the AddColumn method to increase the number of columns.

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement | Site Feedback
Page view tracker