![]() | Type | Description | ||
| ItemIndex as Long | A long value that indicates the index of item being clicked. | |||
| ColIndex as Long | A long value that indicates the index of column, where the cell's icon is clicked. |
The CellImageClick event is fired when user clicks on the cell's image. Use the CellImage property to assign an icon to a cell. Use the CellImages property to assign multiple icons to a cell. Use the ItemFromPoint property to determine the index of the icon being clicked, in case the cell displays multiple icons using the CellImages property. Use the CellHasCheckBox or CellHasRadioButton property to assign a check box or a radio button to a cell.
The following VB sample changes the cell's icon when it is clicked:
Private Sub List1_CellImageClick(ByVal Index As Long, ByVal ColIndex As Long)
With List1.Items
.CellImage(Index, ColIndex) = 1 + (.CellImage(Index, ColIndex)) Mod 2
End With
End SubThe following C++ sample changes the cell's icon when it is clicked:
void OnCellImageClickList1(long ItemIndex, long ColIndex)
{
COleVariant vtColumn( ColIndex );
CItems items = m_list.GetItems();
items.SetCellImage( ItemIndex, vtColumn, ( items.GetCellImage( ItemIndex, vtColumn ) % 2 ) + 1 );
}The following VB.NET sample changes the cell's icon when it is clicked:
Private Sub AxList1_CellImageClick(ByVal sender As Object, ByVal e As AxEXLISTLib._IListEvents_CellImageClickEvent) Handles AxList1.CellImageClick
With AxList1.Items
.CellImage(e.itemIndex, e.colIndex) = .CellImage(e.itemIndex, e.colIndex) Mod 2 + 1
End With
End SubThe following C# sample changes the cell's icon when it is clicked:
private void axList1_CellImageClick(object sender, AxEXLISTLib._IListEvents_CellImageClickEvent e)
{
axList1.Items.set_CellImage(e.itemIndex, e.colIndex, axList1.Items.get_CellImage(e.itemIndex, e.colIndex) % 2 + 1);
}The following VFP sample changes the cell's icon when it is clicked:
*** ActiveX Control Event *** LPARAMETERS itemindex, colindex with thisform.List1.Items .CellImage( itemindex, colindex ) = mod( .CellImage( itemindex, colindex ), 2) + 1 endwith