Type | Description | |||
ElementFrom as Element | An Element object that specifies where the link starts from. | |||
ElementTo as Element | An Element object that specifies where the link ends to. | |||
Cancel as Boolean | (By Reference) A Boolean expression that specifies whether the operation is canceled or allowed, or if the link will or will not be added. |
The following VB sample prevents adding cycles to the chart:
Private Sub Surface1_AllowLink(ByVal ElementFrom As EXSURFACELibCtl.IElement, ByVal ElementTo As EXSURFACELibCtl.IElement, Cancel As Boolean) Cancel = ElementTo.PathTo(ElementFrom) End Sub
The order of the events when the user links two elements at runtime is:
The AllowLink event is not called during the LoadXML method.
Syntax for AllowLink event, /NET version, on:
private void AllowLink(object sender,exontrol.EXSURFACELib.Element ElementFrom,exontrol.EXSURFACELib.Element ElementTo,ref bool Cancel) { } Private Sub AllowLink(ByVal sender As System.Object,ByVal ElementFrom As exontrol.EXSURFACELib.Element,ByVal ElementTo As exontrol.EXSURFACELib.Element,ByRef Cancel As Boolean) Handles AllowLink End Sub |
private void AllowLink(object sender, AxEXSURFACELib._ISurfaceEvents_AllowLinkEvent e) { } void OnAllowLink(LPDISPATCH ElementFrom,LPDISPATCH ElementTo,BOOL FAR* Cancel) { } void __fastcall AllowLink(TObject *Sender,Exsurfacelib_tlb::IElement *ElementFrom,Exsurfacelib_tlb::IElement *ElementTo,VARIANT_BOOL * Cancel) { } procedure AllowLink(ASender: TObject; ElementFrom : IElement;ElementTo : IElement;var Cancel : WordBool); begin end; procedure AllowLink(sender: System.Object; e: AxEXSURFACELib._ISurfaceEvents_AllowLinkEvent); begin end; begin event AllowLink(oleobject ElementFrom,oleobject ElementTo,boolean Cancel) end event AllowLink Private Sub AllowLink(ByVal sender As System.Object, ByVal e As AxEXSURFACELib._ISurfaceEvents_AllowLinkEvent) Handles AllowLink End Sub Private Sub AllowLink(ByVal ElementFrom As EXSURFACELibCtl.IElement,ByVal ElementTo As EXSURFACELibCtl.IElement,Cancel As Boolean) End Sub Private Sub AllowLink(ByVal ElementFrom As Object,ByVal ElementTo As Object,Cancel As Boolean) End Sub LPARAMETERS ElementFrom,ElementTo,Cancel PROCEDURE OnAllowLink(oSurface,ElementFrom,ElementTo,Cancel) RETURN |
<SCRIPT EVENT="AllowLink(ElementFrom,ElementTo,Cancel)" LANGUAGE="JScript"> </SCRIPT> <SCRIPT LANGUAGE="VBScript"> Function AllowLink(ElementFrom,ElementTo,Cancel) End Function </SCRIPT> Procedure OnComAllowLink Variant llElementFrom Variant llElementTo Boolean llCancel Forward Send OnComAllowLink llElementFrom llElementTo llCancel End_Procedure METHOD OCX_AllowLink(ElementFrom,ElementTo,Cancel) CLASS MainDialog RETURN NIL void onEvent_AllowLink(COM _ElementFrom,COM _ElementTo,COMVariant /*bool*/ _Cancel) { } function AllowLink as v (ElementFrom as OLE::Exontrol.Surface.1::IElement,ElementTo as OLE::Exontrol.Surface.1::IElement,Cancel as L) end function function nativeObject_AllowLink(ElementFrom,ElementTo,Cancel) return |