Fired after the user clicks on the cell of button type.
![]() | Type | Description | ||
| Item as HITEM | A long expression that indicates the handle of the item where the user clicks the cell's button. | |||
| ColIndex as Long | A long expression that specifies the index of the column where the user clicks the cell's button, or a long expression that indicates the handle of the cell being clicked, if the Item parameter is 0. |
The CellButtonClick event is fired after the user has released the left mouse button over a cell of button type. Use the CellHasButton property to specify whether a cell is of button type. The CellButtonClick event notifies your application that user presses a cell of button type.
The following VB sample sets the cells of the first column to be of button type, and displays a message when one of them has been clicked.
Private Sub Gantt1_AddItem(ByVal Item As EXGANTTLibCtl.HITEM) Gantt1.Items.CellHasButton(Item, 0) = True End Sub Private Sub Gantt1_CellButtonClick(ByVal Item As EXGANTTLibCtl.HITEM, ByVal ColIndex As Long) MsgBox "The cell of button type has been clicked" End Sub
The following VB.NET sample displays a message when the user clicks a button in the cell:
Private Sub AxGantt1_CellButtonClick(ByVal sender As Object, ByVal e As AxEXGANTTLib._IGanttEvents_CellButtonClickEvent) Handles AxGantt1.CellButtonClick
MsgBox("The cell of button type has been clicked")
End Sub
The following C# sample displays a message when the user clicks a button in the cell:
private void axGantt1_CellButtonClick(object sender, AxEXGANTTLib._IGanttEvents_CellButtonClickEvent e)
{
MessageBox.Show("The cell of button type has been clicked");
}
The following C++ sample displays a message when the user clicks a button in the cell:
void OnCellButtonClickGantt1(long Item, long ColIndex)
{
MessageBox( "The cell of button type has been clicked." );
}
The following VFP sample displays a message when the user clicks a button in the cell:
*** ActiveX Control Event *** LPARAMETERS item, colindex wait window "The cell of button type has been clicked."