event OleEvent (Element as Element, Ev as OleEvent)
Occurs once an inside control fires an event.

TypeDescription
Element as Element An Element object that hosts the ActiveX control.
Ev as OleEvent A OleEvent object that contains information about the event.
The ExSurface component supports ActiveX hosting. The Type property on exElementHostControl, specifies that the element hosts an inside control. The Control property specifies the program identifier of the control to be hosted. In case you are inserting a runtime-licensed control you must specify the License property, prior calling the Control property. The Object property specifies the object being hosted ( a reference to the inside ActiveX control ). The OleEvent event occurs once an inner control fires an event. Use the ToString property of the OleEvent object to display general information about the fired event.

The following screen shot shows the Exontrol.Grid on the surface:

Syntax for OleEvent event, /NET version, on:

private void OleEvent(object sender,exontrol.EXSURFACELib.Element Element,exontrol.EXSURFACELib.OleEvent Ev)
{
}

Private Sub OleEvent(ByVal sender As System.Object,ByVal Element As exontrol.EXSURFACELib.Element,ByVal Ev As exontrol.EXSURFACELib.OleEvent) Handles OleEvent
End Sub

Syntax for OleEvent event, /COM version, on:

private void OleEvent(object sender, AxEXSURFACELib._ISurfaceEvents_OleEventEvent e)
{
}

void OnOleEvent(LPDISPATCH Element,LPDISPATCH Ev)
{
}

void __fastcall OleEvent(TObject *Sender,Exsurfacelib_tlb::IElement *Element,Exsurfacelib_tlb::IOleEvent *Ev)
{
}

procedure OleEvent(ASender: TObject; Element : IElement;Ev : IOleEvent);
begin
end;

procedure OleEvent(sender: System.Object; e: AxEXSURFACELib._ISurfaceEvents_OleEventEvent);
begin
end;

begin event OleEvent(oleobject Element,oleobject Ev)
end event OleEvent

Private Sub OleEvent(ByVal sender As System.Object, ByVal e As AxEXSURFACELib._ISurfaceEvents_OleEventEvent) Handles OleEvent
End Sub

Private Sub OleEvent(ByVal Element As EXSURFACELibCtl.IElement,ByVal Ev As EXSURFACELibCtl.IOleEvent)
End Sub

Private Sub OleEvent(ByVal Element As Object,ByVal Ev As Object)
End Sub

LPARAMETERS Element,Ev

PROCEDURE OnOleEvent(oSurface,Element,Ev)
RETURN

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

<SCRIPT EVENT="OleEvent(Element,Ev)" LANGUAGE="JScript">
</SCRIPT>

<SCRIPT LANGUAGE="VBScript">
Function OleEvent(Element,Ev)
End Function
</SCRIPT>

Procedure OnComOleEvent Variant llElement Variant llEv
	Forward Send OnComOleEvent llElement llEv
End_Procedure

METHOD OCX_OleEvent(Element,Ev) CLASS MainDialog
RETURN NIL

void onEvent_OleEvent(COM _Element,COM _Ev)
{
}

function OleEvent as v (Element as OLE::Exontrol.Surface.1::IElement,Ev as OLE::Exontrol.Surface.1::IOleEvent)
end function

function nativeObject_OleEvent(Element,Ev)
return

The following VB sample adds a command button:

With Surface1
    With .Elements
        With .Add("activex hosting")
            .Type = exElementHostControl
            .Control = "Forms.CommandButton.1"
        End With
    End With
End With

The following sample displays information about fired event:

Private Sub Surface1_OleEvent(ByVal Element As EXSURFACELibCtl.IElement, ByVal Ev As EXSURFACELibCtl.IOleEvent)
    Debug.Print Ev.ToString()
End Sub