event UserEditorOleEvent (Object as Object, Ev as OleEvent, CloseEditor as Boolean, Node as Node)
Occurs when an user editor fires an event.

 TypeDescription 
   Object as Object An object created by UserEditor property.  
   Ev as OleEvent An OleEvent object that holds information about the event   
   CloseEditor as Boolean A boolean expression that indicates whether the control should close the user editor.  
   Node as Node A Node object where the ActiveX editor is opened.   
The UserEditorOleEvent is fired every time when an user editor object fires an event. The information about fired event is stored by Ev parameter. The CloseEditor parameter is useful to inform the control when the editor should be hidden. The UserEditorOpen event is fired when the control shows an ActiveX editor. The control fires the UserEditorClose event when the user closes the ActiveX editor ( for instance, when he clicks outside the editing node ). Use the Add method and UserEditorType type to add an ActiveX editor to the control. Use the UserEditor method to create an ActiveX editor. Use the UserEditorObject property to get the ActiveX editor created by the UserEditor method.

Syntax for UserEditorOleEvent event, /NET version, on:

private void UserEditorOleEvent(object sender,object Obj,exontrol.EXMLGRIDLib.OleEvent Ev,ref bool CloseEditor,exontrol.EXMLGRIDLib.Node Node)
{
}

Private Sub UserEditorOleEvent(ByVal sender As System.Object,ByVal Obj As Object,ByVal Ev As exontrol.EXMLGRIDLib.OleEvent,ByRef CloseEditor As Boolean,ByVal Node As exontrol.EXMLGRIDLib.Node) Handles UserEditorOleEvent
End Sub

Syntax for UserEditorOleEvent event, /COM version, on:

private void UserEditorOleEvent(object sender, AxEXMLGRIDLib._IXMLGridEvents_UserEditorOleEventEvent e)
{
}

void OnUserEditorOleEvent(LPDISPATCH Object,LPDISPATCH Ev,BOOL FAR* CloseEditor,LPDISPATCH Node)
{
}

void __fastcall UserEditorOleEvent(TObject *Sender,IDispatch *Object,Exmlgridlib_tlb::IOleEvent *Ev,VARIANT_BOOL * CloseEditor,Exmlgridlib_tlb::INode *Node)
{
}

procedure UserEditorOleEvent(ASender: TObject; Object : IDispatch;Ev : IOleEvent;var CloseEditor : WordBool;Node : INode);
begin
end;

procedure UserEditorOleEvent(sender: System.Object; e: AxEXMLGRIDLib._IXMLGridEvents_UserEditorOleEventEvent);
begin
end;

begin event UserEditorOleEvent(oleobject Object,oleobject Ev,boolean CloseEditor,oleobject Node)
end event UserEditorOleEvent

Private Sub UserEditorOleEvent(ByVal sender As System.Object, ByVal e As AxEXMLGRIDLib._IXMLGridEvents_UserEditorOleEventEvent) Handles UserEditorOleEvent
End Sub

Private Sub UserEditorOleEvent(ByVal Object As Object,ByVal Ev As EXMLGRIDLibCtl.IOleEvent,CloseEditor As Boolean,ByVal Node As EXMLGRIDLibCtl.INode)
End Sub

Private Sub UserEditorOleEvent(ByVal Object As Object,ByVal Ev As Object,CloseEditor As Boolean,ByVal Node As Object)
End Sub

LPARAMETERS Object,Ev,CloseEditor,Node

PROCEDURE OnUserEditorOleEvent(oXMLGrid,Object,Ev,CloseEditor,Node)
RETURN

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

<SCRIPT EVENT="UserEditorOleEvent(Object,Ev,CloseEditor,Node)" LANGUAGE="JScript">
</SCRIPT>

<SCRIPT LANGUAGE="VBScript">
Function UserEditorOleEvent(Object,Ev,CloseEditor,Node)
End Function
</SCRIPT>

Procedure OnComUserEditorOleEvent Variant llObject Variant llEv Boolean llCloseEditor Variant llNode
	Forward Send OnComUserEditorOleEvent llObject llEv llCloseEditor llNode
End_Procedure

METHOD OCX_UserEditorOleEvent(Object,Ev,CloseEditor,Node) CLASS MainDialog
RETURN NIL

void onEvent_UserEditorOleEvent(COM _Object,COM _Ev,COMVariant /*bool*/ _CloseEditor,COM _Node)
{
}

function UserEditorOleEvent as v (Object as P,Ev as OLE::Exontrol.XMLGrid.1::IOleEvent,CloseEditor as L,Node as OLE::Exontrol.XMLGrid.1::INode)
end function

function nativeObject_UserEditorOleEvent(Object,Ev,CloseEditor,Node)
return

The following VB sample closes the Exontrol's ExComboBox user editor when the user selects a new value, or when it presses the Escape key. Also the sample changes the value of the node in the ExComboBox control:

Private Sub XMLGrid1_UserEditorOleEvent(ByVal Object As Object, ByVal Ev As EXMLGRIDLibCtl.IOleEvent, CloseEditor As Boolean, ByVal Node As EXMLGRIDLibCtl.INode)
    If (Ev.Name = "Change") Then
        Node.Value = Object.Select(0)
        CloseEditor = True
    End If
    
    If (Ev.Name = "KeyPress") Then
        Dim l As Long
        l = Ev(0).Value
        If l = vbKeyEscape Then
            CloseEditor = True
        End If
    End If
End Sub

the sample requires an ActiveX editor ( in our case the Exontrol's ExComboBox control ):

The following C++ sample closes the Exontrol's ExComboBox user editor when the user selects a new value, or when it presses the Escape key. Also the sample changes the value of the node in the ExComboBox control:

#import <exmlgrid.dll>
#import <excombobox.dll>
void OnUserEditorOleEventXmlgrid1(LPDISPATCH Object, LPDISPATCH Ev, BOOL FAR* CloseEditor, LPDISPATCH Node) 
{
	EXMLGRIDLib::IOleEventPtr spEvent = Ev;
	EXCOMBOBOXLib::IComboBoxPtr spComboBox = Object;
	if ( spComboBox != NULL )
		if ( spEvent != NULL  )
		{
			if ( spEvent->Name.operator ==( "Change" ) )
			{
				CNode node( Node );
				node.SetValue( spComboBox->GetSelect( COleVariant( (long)0 ) ) );
				*CloseEditor = TRUE;
			}
			else
				if ( spEvent->Name.operator ==( "KeyPress" ) )
				{
					// gets the KeyCode parameter
					EXMLGRIDLib::IOleEventParamPtr spParam;
					if ( SUCCEEDED( spEvent->get_Param( COleVariant( (long)0 ), &spParam ) ) )
					{
						COleVariant vtI4;
						vtI4.ChangeType( VT_I4, &spParam->Value );
						if ( V_I4( &vtI4) == VK_ESCAPE )
							*CloseEditor = TRUE;
					}
				}
		}
}

the sample requires an ActiveX editor ( in our case the Exontrol's ExComboBox control ), so we need to call the #import <excombobox.dll> in order to include definitions for objects and types in the ExComboBox control. The #import <excombobox.dll> creates EXCOMBOBOXLib namespace that includes all definitions for objects and types that the ExComboBox control exports.

The following VB.NET sample closes the Exontrol's ExComboBox user editor when the user selects a new value, or when it presses the Escape key. Also the sample changes the value of the node in the ExComboBox control:

Private Sub AxXMLGrid1_UserEditorOleEvent(ByVal sender As Object, ByVal e As AxEXMLGRIDLib._IXMLGridEvents_UserEditorOleEventEvent) Handles AxXMLGrid1.UserEditorOleEvent
    If (e.ev.Name = "Change") Then
        e.node.Value = e.object.Select(0)
        e.closeEditor = True
    End If

    If (e.ev.Name = "KeyPress") Then
        Dim l As Integer = e.ev(0).Value
        If l = Keys.Escape Then
            e.closeEditor = True
        End If
    End If
End Sub

the sample requires an ActiveX editor ( in our case the Exontrol's ExComboBox control ):

The following C# sample closes the Exontrol's ExComboBox user editor when the user selects a new value, or when it presses the Escape key. Also the sample changes the value of the node in the ExComboBox control:

private void axXMLGrid1_UserEditorOleEvent(object sender, AxEXMLGRIDLib._IXMLGridEvents_UserEditorOleEventEvent e)
{
	if (e.ev.Name == "Change")
	{
		EXCOMBOBOXLib.ComboBox comboBox = e.@object as EXCOMBOBOXLib.ComboBox;
		if ( comboBox != null )
			e.node.Value = comboBox.get_Select(0);
		e.closeEditor = true;
	}
	else
		if (e.ev.Name == "KeyPress")
		{
			if (Convert.ToInt16(e.ev[0].Value) == Convert.ToInt16(Keys.Escape))
				e.closeEditor = true;
		}
}

the sample requires an ActiveX editor ( in our case the Exontrol's ExComboBox control ):

In C# your project needs a new reference to the Exontrol's ExComboBox control library. Use the Project\Add Reference\COM item to add new reference to a COM object. Once that you added a reference to the Exontrol's ExComboBox the EXCOMBOBOXLib namespace is created. The EXCOMBOBOXLib namespace contains definitions for all objects that ExComboBox control exports.

The following VFP sample closes the Exontrol's ExComboBox user editor when the user selects a new value, or when it presses the Escape key. Also the sample changes the value of the node in the ExComboBox control:

*** ActiveX Control Event ***
LPARAMETERS object, ev, closeeditor, node

If (ev.Name = "Change") Then
    node.Value = object.Select(0)
    closeeditor = .t.
else
	If (ev.Name = "KeyPress") Then
	    local l
	    l = Ev(0).Value
	    If l = 27 Then
	        closeeditor = .t.
	    EndIf
	EndIf
EndIf

the sample requires an ActiveX editor ( in our case the Exontrol's ExComboBox control ):


Send comments on this topic.
1999-2015 Exontrol.COM, Software. All rights reserved.