Fired after the user clicks on the cell of button type.
Type | Description | |||
Cell as HCELL | A long expression that indicates the handle of the cell being clicked. |
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 CellCaption property to determine the caption of the cell being clicked.
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 ComboBox1_InsertItem(ByVal Item As EXCOMBOBOXLibCtl.HITEM) ComboBox1.Items.CellHasButton(Item, 0) = True End Sub Private Sub ComboBox1_CellButtonClick(ByVal Cell As EXCOMBOBOXLibCtl.HCELL) MsgBox "The user clicks the cell's button. " & ComboBox1.Items.CellCaption(, Cell) End Sub
The following C++ sample displays a message when the user clicks a button in the cell:
void OnCellButtonClickCombobox1(long Cell) { COleVariant vtMissing; V_VT( &vtMissing ) = VT_ERROR; CString strCaption = V2S( &m_combobox.GetItems().GetCellCaption( vtMissing, COleVariant( (long)Cell ) ) ); MessageBox( "The cell of button type has been clicked." + 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 displays a message when the user clicks a button in the cell:
Private Sub AxComboBox1_CellButtonClick(ByVal sender As Object, ByVal e As AxEXCOMBOBOXLib._IComboBoxEvents_CellButtonClickEvent) Handles AxComboBox1.CellButtonClick MsgBox("The cell of button type has been clicked." & AxComboBox1.Items.CellCaption(, e.cell)) End Sub
The following C# sample displays a message when the user clicks a button in the cell:
private void axComboBox1_CellButtonClick(object sender, AxEXCOMBOBOXLib._IComboBoxEvents_CellButtonClickEvent e) { MessageBox.Show("The cell of button type has been clicked. " + axComboBox1.Items.get_CellCaption(null, e.cell).ToString() ); }
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."
Syntax for CellButtonClick event, /NET version, on:
private void CellButtonClick(object sender,exontrol.EXCOMBOBOXLib.HCELL Cell) { } Private Sub CellButtonClick(ByVal sender As System.Object,ByVal Cell As exontrol.EXCOMBOBOXLib.HCELL) Handles CellButtonClick End Sub |
private void CellButtonClick(object sender, AxEXCOMBOBOXLib._IComboBoxEvents_CellButtonClickEvent e) { } void OnCellButtonClick(long Cell) { } void __fastcall CellButtonClick(TObject *Sender,Excomboboxlib_tlb::HCELL Cell) { } procedure CellButtonClick(ASender: TObject; Cell : HCELL); begin end; procedure CellButtonClick(sender: System.Object; e: AxEXCOMBOBOXLib._IComboBoxEvents_CellButtonClickEvent); begin end; begin event CellButtonClick(long Cell) end event CellButtonClick Private Sub CellButtonClick(ByVal sender As System.Object, ByVal e As AxEXCOMBOBOXLib._IComboBoxEvents_CellButtonClickEvent) Handles CellButtonClick End Sub Private Sub CellButtonClick(ByVal Cell As EXCOMBOBOXLibCtl.HCELL) End Sub Private Sub CellButtonClick(ByVal Cell As Long) End Sub LPARAMETERS Cell PROCEDURE OnCellButtonClick(oComboBox,Cell) RETURN |
<SCRIPT EVENT="CellButtonClick(Cell)" LANGUAGE="JScript"> </SCRIPT> <SCRIPT LANGUAGE="VBScript"> Function CellButtonClick(Cell) End Function </SCRIPT> Procedure OnComCellButtonClick HCELL llCell Forward Send OnComCellButtonClick llCell End_Procedure METHOD OCX_CellButtonClick(Cell) CLASS MainDialog RETURN NIL void onEvent_CellButtonClick(int _Cell) { } function CellButtonClick as v (Cell as OLE::Exontrol.ComboBox.1::HCELL) end function function nativeObject_CellButtonClick(Cell) return |