Fired after cell's state has been changed.
Type | Description | |||
Cell as HCELL | A long expression that indicates the handle of the cell whose state is changed. |
A cell that contains a radio button or a check box button fires the CellStateChanged event when its state is changed. Use the CellState property to change the cell's state. Use the CellHasRadioButton or CellHasCheckBox property to enable radio or check box button into a cell. Use the CellImage property to display an icon in the cell. Use the CellImages property to display multiple icons in the same cell. Use the CellChecked property to determine the handle of the cell that's checked in a radio group. Use the CellRadioGroup property to radio group cells.
The following VB sample displays a message when the user clicks a check box or a radio button:
Private Sub ComboBox1_CellStateChanged(ByVal Cell As EXCOMBOBOXLibCtl.HCELL) With ComboBox1.Items Debug.Print "The cell """ & .CellCaption(, Cell) & """ has changed its state. The new state is " & IIf(.CellState(, Cell) = 0, "Unchecked", "Checked") End With End Sub
The following VC sample displays the caption of the cell whose checkbox's state is changed:
#include "Items.h"
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; } void OnCellStateChangedCombobox1(long Cell) { if ( ::IsWindow( m_combobox.m_hWnd ) ) { CItems items = m_combobox.GetItems(); COleVariant vtMissing; V_VT( &vtMissing ) = VT_ERROR; COleVariant vtCell( Cell ); CString strCellCaption = V2S( &items.GetCellCaption( vtMissing, vtCell ) ); CString strOutput; strOutput.Format( "'%s''s checkbox state is %i\r\n", strCellCaption, items.GetCellState( vtMissing, vtCell ) ); OutputDebugString( strOutput ); } }
The following VB.NET sample displays a message when the user clicks a check box or a radio button:
Private Sub AxComboBox1_CellStateChanged(ByVal sender As Object, ByVal e As AxEXCOMBOBOXLib._IComboBoxEvents_CellStateChangedEvent) Handles AxComboBox1.CellStateChanged With AxComboBox1.Items Debug.Print("The cell """ & .CellCaption(, e.cell) & """ has changed its state. The new state is " & IIf(.CellState(, e.cell) = 0, "Unchecked", "Checked")) End With End Sub
The following C# sample outputs a message when the user clicks a check box or a radio button:
private void axComboBox1_CellStateChanged(object sender, AxEXCOMBOBOXLib._IComboBoxEvents_CellStateChangedEvent e) { string strOutput = axComboBox1.Items.get_CellCaption(null, e.cell).ToString(); strOutput += " state = " + axComboBox1.Items.get_CellState(null, e.cell).ToString(); System.Diagnostics.Debug.WriteLine(strOutput); }
The following VFP sample prints a message when the user clicks a check box or a radio button:
*** ActiveX Control Event *** LPARAMETERS cell local sOutput sOutput = "" with thisform.ComboBox1.Items .DefaultItem = .CellItem(cell) sOutput = .CellCaption( 0, 0 ) sOutput = sOutput + ", state = " + str(.CellState( 0, 0 )) wait window nowait sOutput endwith
Syntax for CellStateChanged event, /NET version, on:
private void CellStateChanged(object sender,exontrol.EXCOMBOBOXLib.HCELL Cell) { } Private Sub CellStateChanged(ByVal sender As System.Object,ByVal Cell As exontrol.EXCOMBOBOXLib.HCELL) Handles CellStateChanged End Sub |
private void CellStateChanged(object sender, AxEXCOMBOBOXLib._IComboBoxEvents_CellStateChangedEvent e) { } void OnCellStateChanged(long Cell) { } void __fastcall CellStateChanged(TObject *Sender,Excomboboxlib_tlb::HCELL Cell) { } procedure CellStateChanged(ASender: TObject; Cell : HCELL); begin end; procedure CellStateChanged(sender: System.Object; e: AxEXCOMBOBOXLib._IComboBoxEvents_CellStateChangedEvent); begin end; begin event CellStateChanged(long Cell) end event CellStateChanged Private Sub CellStateChanged(ByVal sender As System.Object, ByVal e As AxEXCOMBOBOXLib._IComboBoxEvents_CellStateChangedEvent) Handles CellStateChanged End Sub Private Sub CellStateChanged(ByVal Cell As EXCOMBOBOXLibCtl.HCELL) End Sub Private Sub CellStateChanged(ByVal Cell As Long) End Sub LPARAMETERS Cell PROCEDURE OnCellStateChanged(oComboBox,Cell) RETURN |
<SCRIPT EVENT="CellStateChanged(Cell)" LANGUAGE="JScript"> </SCRIPT> <SCRIPT LANGUAGE="VBScript"> Function CellStateChanged(Cell) End Function </SCRIPT> Procedure OnComCellStateChanged HCELL llCell Forward Send OnComCellStateChanged llCell End_Procedure METHOD OCX_CellStateChanged(Cell) CLASS MainDialog RETURN NIL void onEvent_CellStateChanged(int _Cell) { } function CellStateChanged as v (Cell as OLE::Exontrol.ComboBox.1::HCELL) end function function nativeObject_CellStateChanged(Cell) return |