Type | Description | |||
Object as Object | An object created by UserEditor property. | |||
Item as HITEM | A long expression that determines the item's handle. If the Item parameter is 0, and the ColIndex property is different than zero, the ColIndex indicates the handle of the cell where the state is changed. | |||
ColIndex as Long | A long expression that indicates the column's index, if the Item parameter is not zero, a long expression that indicates the handle of the cell if the Item parameter is 0. |
Use the UserEditorClose event to notify your application when the user editor is hidden. Use the UserEditorClose event to update the cell's value when user editor is hidden. The control fires UserEditorOleEvent event each time when a an user editor object fires an event.
Syntax for UserEditorClose event, /NET version, on:
private void UserEditorClose(object sender,object Obj,int Item,int ColIndex) { } Private Sub UserEditorClose(ByVal sender As System.Object,ByVal Obj As Object,ByVal Item As Integer,ByVal ColIndex As Integer) Handles UserEditorClose End Sub |
private void UserEditorClose(object sender, AxEXG2ANTTLib._IG2anttEvents_UserEditorCloseEvent e) { } void OnUserEditorClose(LPDISPATCH Object,long Item,long ColIndex) { } void __fastcall UserEditorClose(TObject *Sender,IDispatch *Object,Exg2anttlib_tlb::HITEM Item,long ColIndex) { } procedure UserEditorClose(ASender: TObject; Object : IDispatch;Item : HITEM;ColIndex : Integer); begin end; procedure UserEditorClose(sender: System.Object; e: AxEXG2ANTTLib._IG2anttEvents_UserEditorCloseEvent); begin end; begin event UserEditorClose(oleobject Object,long Item,long ColIndex) end event UserEditorClose Private Sub UserEditorClose(ByVal sender As System.Object, ByVal e As AxEXG2ANTTLib._IG2anttEvents_UserEditorCloseEvent) Handles UserEditorClose End Sub Private Sub UserEditorClose(ByVal Object As Object,ByVal Item As EXG2ANTTLibCtl.HITEM,ByVal ColIndex As Long) End Sub Private Sub UserEditorClose(ByVal Object As Object,ByVal Item As Long,ByVal ColIndex As Long) End Sub LPARAMETERS Object,Item,ColIndex PROCEDURE OnUserEditorClose(oG2antt,Object,Item,ColIndex) RETURN |
<SCRIPT EVENT="UserEditorClose(Object,Item,ColIndex)" LANGUAGE="JScript"> </SCRIPT> <SCRIPT LANGUAGE="VBScript"> Function UserEditorClose(Object,Item,ColIndex) End Function </SCRIPT> Procedure OnComUserEditorClose Variant llObject HITEM llItem Integer llColIndex Forward Send OnComUserEditorClose llObject llItem llColIndex End_Procedure METHOD OCX_UserEditorClose(Object,Item,ColIndex) CLASS MainDialog RETURN NIL void onEvent_UserEditorClose(COM _Object,int _Item,int _ColIndex) { } function UserEditorClose as v (Object as P,Item as OLE::Exontrol.G2antt.1::HITEM,ColIndex as N) end function function nativeObject_UserEditorClose(Object,Item,ColIndex) return |
The following VB sample updates the cell's value when the user editor is hidden ( the sample handles the event for an exMaskEdit inside ):
Private Sub G2antt1_UserEditorClose(ByVal Object As Object, ByVal Item As EXG2ANTTLibCtl.HITEM, ByVal ColIndex As Long) With G2antt1.Items .CellValue(Item, ColIndex) = Object.Text End With End Sub
The following C++ sample updates the cell's value when the user editor is hidden ( the sample handles the event for an exMaskEdit inside ):
#import <maskedit.dll> #include "Items.h" void OnUserEditorCloseG2antt1(LPDISPATCH Object, long Item, long ColIndex) { MaskEditLib::IMaskEditPtr spMaskEdit( Object ); if ( spMaskEdit != NULL ) { COleVariant vtNewValue(spMaskEdit->GetText()); m_g2antt.GetItems().SetCellValue( COleVariant( Item ), COleVariant( ColIndex ), vtNewValue ); } }
where the #import <maskedit.dll> defines the type library of the exMaskEdit component, in the MaskEditLib namespace. The V2S function converts a VARIANT value to a string value and may look like follows:
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 updates the cell's value when the user editor is hidden ( the sample handles the event for an exMaskEdit inside ):
Private Sub AxG2antt1_UserEditorClose(ByVal sender As Object, ByVal e As AxEXG2ANTTLib._IG2anttEvents_UserEditorCloseEvent) Handles AxG2antt1.UserEditorClose With AxG2antt1.Items .CellValue(e.item, e.colIndex) = e.object.Text End With End Sub
The following C# sample updates the cell's value when the user editor is hidden ( the sample handles the event for an exMaskEdit inside ):
private void axG2antt1_UserEditorClose(object sender, AxEXG2ANTTLib._IG2anttEvents_UserEditorCloseEvent e) { MaskEditLib.MaskEdit maskEdit = e.@object as MaskEditLib.MaskEdit; if (maskEdit != null) axG2antt1.Items.set_CellValue(e.item, e.colIndex, maskEdit.Text); }
where the MaskEditLib class is defined by adding a new reference to the ExMaskEdit component to your project.
The following VFP sample updates the cell's value when the user editor is hidden ( the sample handles the event for an exMaskEdit inside ):
*** ActiveX Control Event *** LPARAMETERS object, item, colindex with thisform.G2antt1.Items .DefaultItem = item .CellValue( 0, colindex ) = object.Text() endwith