event CellButtonClick (ItemIndex as Long, ColIndex as Long)
Fired after the user clicks the cell's button.

TypeDescription
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 the column.

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. Use the Caption property to specify the button's caption.

Syntax for CellButtonClick event, /NET version, on:

private void CellButtonClick(object sender,int ItemIndex,int ColIndex)
{
}

Private Sub CellButtonClick(ByVal sender As System.Object,ByVal ItemIndex As Integer,ByVal ColIndex As Integer) Handles CellButtonClick
End Sub

Syntax for CellButtonClick event, /COM version, on:

private void CellButtonClick(object sender, AxEXLISTLib._IListEvents_CellButtonClickEvent e)
{
}

void OnCellButtonClick(long ItemIndex,long ColIndex)
{
}

void __fastcall CellButtonClick(TObject *Sender,long ItemIndex,long ColIndex)
{
}

procedure CellButtonClick(ASender: TObject; ItemIndex : Integer;ColIndex : Integer);
begin
end;

procedure CellButtonClick(sender: System.Object; e: AxEXLISTLib._IListEvents_CellButtonClickEvent);
begin
end;

begin event CellButtonClick(long ItemIndex,long ColIndex)
end event CellButtonClick

Private Sub CellButtonClick(ByVal sender As System.Object, ByVal e As AxEXLISTLib._IListEvents_CellButtonClickEvent) Handles CellButtonClick
End Sub

Private Sub CellButtonClick(ByVal ItemIndex As Long,ByVal ColIndex As Long)
End Sub

Private Sub CellButtonClick(ByVal ItemIndex As Long,ByVal ColIndex As Long)
End Sub

LPARAMETERS ItemIndex,ColIndex

PROCEDURE OnCellButtonClick(oList,ItemIndex,ColIndex)
RETURN

Syntax for CellButtonClick event, /COM version (others), on:

<SCRIPT EVENT="CellButtonClick(ItemIndex,ColIndex)" LANGUAGE="JScript">
</SCRIPT>

<SCRIPT LANGUAGE="VBScript">
Function CellButtonClick(ItemIndex,ColIndex)
End Function
</SCRIPT>

Procedure OnComCellButtonClick Integer llItemIndex Integer llColIndex
	Forward Send OnComCellButtonClick llItemIndex llColIndex
End_Procedure

METHOD OCX_CellButtonClick(ItemIndex,ColIndex) CLASS MainDialog
RETURN NIL

void onEvent_CellButtonClick(int _ItemIndex,int _ColIndex)
{
}

function CellButtonClick as v (ItemIndex as N,ColIndex as N)
end function

function nativeObject_CellButtonClick(ItemIndex,ColIndex)
return

The following VB sample  prints the caption of the cell being clicked:

Private Sub List1_CellButtonClick(ByVal Index As Long, ByVal ColIndex As Long)
    Debug.Print List1.Items.Caption(Index, ColIndex)
End Sub

The following C++ sample  prints the caption of the cell being clicked:

void OnCellButtonClickList1(long ItemIndex, long ColIndex) 
{
	CItems items = m_list.GetItems();
	CString strCaption = V2S( &items.GetCaption( ItemIndex, COleVariant( ColIndex ) ) );
	OutputDebugString( strCaption );
}

where the V2S function converts a VARIANT expression to a string expression,

static CString V2S( VARIANT* pv, LPCTSTR szDefault = _T("") )
{
	if ( pv )
	{
		if ( pv->vt == VT_ERROR )
			return szDefault;

		COleVariant vt;
		vt.ChangeType( VT_BSTR, pv );
		return V_BSTR( &vt );
	}
	return szDefault;
} 

The following VB.NET sample  prints the caption of the cell being clicked:

Private Sub AxList1_CellButtonClick(ByVal sender As Object, ByVal e As AxEXLISTLib._IListEvents_CellButtonClickEvent) Handles AxList1.CellButtonClick
    With AxList1.Items
        Debug.Write(.Caption(e.itemIndex, e.colIndex))
    End With
End Sub

The following C# sample  prints the caption of the cell being clicked:

private void axList1_CellButtonClick(object sender, AxEXLISTLib._IListEvents_CellButtonClickEvent e)
{
	System.Diagnostics.Debug.WriteLine(axList1.Items.get_Caption(e.itemIndex, e.colIndex).ToString());
}

The following VFP sample  prints the caption of the cell being clicked:

*** ActiveX Control Event ***
LPARAMETERS itemindex, colindex

with thisform.List1.Items
	wait window nowait .Caption(itemindex,colindex)
endwith