Retrieves or sets the column's width.
Type | Description | |||
Long | A long expression that indicates the column's width in pixels. |
The Width property specifies the column's width in pixels. Use the Visible property to hide a column. Use the SortBarColumnWidth property to specify the column's head in the control's sort bar. Use the ColumnAutoResize property to fit all visible columns in the control's client area. Use the FilterBarDropDownWidth property to specify the width of the drop down filter window.
The following VB sample shows how to set the width for all columns:
Private Sub G2antt1_AddColumn(ByVal Column As EXG2ANTTLibCtl.IColumn) Column.Width = 128 End Sub
The following VB.NET sample changes the column's width when a new column is added:
Private Sub AxG2antt1_AddColumn(ByVal sender As Object, ByVal e As AxEXG2ANTTLib._IG2anttEvents_AddColumnEvent) Handles AxG2antt1.AddColumn e.column.Width = 128 End Sub
The following C# sample changes the column's width when a new column is added:
private void axG2antt1_AddColumn(object sender, AxEXG2ANTTLib._IG2anttEvents_AddColumnEvent e) { e.column.Width = 128; }
The following C++ sample changes the column's width when a new column is added:
#include "Column.h" #include "Columns.h" void OnAddColumnG2antt1(LPDISPATCH Column) { CColumn column( Column ); column.SetWidth( 128 ); }
The following VFP sample changes the column's width when a new column is added:
*** ActiveX Control Event *** LPARAMETERS column with column .Width = 128 endwith