event AddColumn (Column as Column)

Fired after a new column has been added.

 TypeDescription 
   Column as Column A Column object that's added to the Columns collection.  

The AddColumn event is fired after a new column has been inserted to Columns collection. Use the AddColumn event to associate extra data to a new column. Use the Add method to add new columns to Columns collection. Use the ColumnAutoSize property to fit all visible columns in the control's client area. 

The following VB sample shows how to set the width for all columns:

Private Sub Gantt1_AddColumn(ByVal Column As EXGANTTLibCtl.IColumn)
    Column.Width = 128
End Sub

The following VB.NET sample  changes the column's width when a new column is added:

Private Sub AxGantt1_AddColumn(ByVal sender As Object, ByVal e As AxEXGANTTLib._IGanttEvents_AddColumnEvent) Handles AxGantt1.AddColumn
    e.column.Width = 128
End Sub

The following C# sample changes the column's width when a new column is added:

private void axGantt1_AddColumn(object sender, AxEXGANTTLib._IGanttEvents_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 OnAddColumnGantt1(LPDISPATCH Column) 
{
	CColumn column( Column );column.m_bAutoRelease = FALSE;
	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

 


Send comments on this topic.
© 1999-2008 Exontrol Inc, Software. All rights reserved.