Type | Description | |||
Data as ExDataObject | An ExDataObject object containing formats that the source will provide and, optionally, the data for those formats. If no data is contained in the ExDataObject, it is provided when the control calls the GetData method. The programmer should provide the values for this parameter in this event. The SetData and Clear methods cannot be used here. | |||
AllowedEffects as Long | A long containing the effects that the source component supports. The possible values are listed in Settings. The programmer should provide the values for this parameter in this event. |
The source component should logically Or together the supported values and
places the result in the AllowedEffects parameter. The target component can
use this value to determine the appropriate action (and what the appropriate
user feedback should be).
You may wish to defer putting data into the ExDataObject object until the
target component requests it. This allows the source component to save time.
If the user does not load any formats into the ExDataObject, then the
drag/drop operation is canceled.
// OLEStartDrag event is not supported. Use the DragEnter,DragLeave,DragOver, DragDrop ... events. // OLEStartDrag event is not supported. Use the DragEnter,DragLeave,DragOver, DragDrop ... events. |
private void OLEStartDrag(object sender, AxEXHTMLLib._IHTMLEvents_OLEStartDragEvent e) { } void OnOLEStartDrag(LPDISPATCH Data,long FAR* AllowedEffects) { } void __fastcall OLEStartDrag(TObject *Sender,Exhtmllib_tlb::IExDataObject *Data,long * AllowedEffects) { } procedure OLEStartDrag(ASender: TObject; Data : IExDataObject;var AllowedEffects : Integer); begin end; procedure OLEStartDrag(sender: System.Object; e: AxEXHTMLLib._IHTMLEvents_OLEStartDragEvent); begin end; begin event OLEStartDrag(oleobject Data,long AllowedEffects) end event OLEStartDrag Private Sub OLEStartDrag(ByVal sender As System.Object, ByVal e As AxEXHTMLLib._IHTMLEvents_OLEStartDragEvent) Handles OLEStartDrag End Sub Private Sub OLEStartDrag(ByVal Data As EXHTMLLibCtl.IExDataObject,AllowedEffects As Long) End Sub Private Sub OLEStartDrag(ByVal Data As Object,AllowedEffects As Long) End Sub LPARAMETERS Data,AllowedEffects PROCEDURE OnOLEStartDrag(oHTML,Data,AllowedEffects) RETURN |
<SCRIPT EVENT="OLEStartDrag(Data,AllowedEffects)" LANGUAGE="JScript"> </SCRIPT> <SCRIPT LANGUAGE="VBScript"> Function OLEStartDrag(Data,AllowedEffects) End Function </SCRIPT> Procedure OnComOLEStartDrag Variant llData Integer llAllowedEffects Forward Send OnComOLEStartDrag llData llAllowedEffects End_Procedure METHOD OCX_OLEStartDrag(Data,AllowedEffects) CLASS MainDialog RETURN NIL // OLEStartDrag event is not supported. Use the DragEnter,DragLeave,DragOver, DragDrop ... events. function OLEStartDrag as v (Data as OLE::Exontrol.HTML.1::IExDataObject,AllowedEffects as N) end function function nativeObject_OLEStartDrag(Data,AllowedEffects) return |
To start accepting drag and drop sources the exGrid control should have the OLEDropMode to exOLEDropManual or exOLEDropAutomatic.
The following VB sample puts the selected text to the clipboard when the drag and drop operation starts ( The OLEDropMode property is exOLEDropManual ):
Private Sub HTML1_OLEStartDrag(ByVal Data As EXHTMLLibCtl.IExDataObject, AllowedEffects As Long) Dim s As String s = HTML1.SelText If (Len(s) > 0) Then AllowedEffects = 1 Data.SetData s, 1 End If End Sub
The following C++ sample puts the selected text to the clipboard when the drag and drop operation starts:
void OnOLEStartDragHTML1(LPDISPATCH Data, long FAR* AllowedEffects) { CString s( m_html.GetSelText() ); if ( s.GetLength() > 0 ) { *AllowedEffects = 1; /*exOLEDropEffectCopy*/ if ( EXHTMLLib::IExDataObjectPtr spData( Data ) ) spData->SetData( COleVariant( s ), COleVariant( long(EXHTMLLib::exCFText) ) ); } }
The C++ sample uses the #import <exhtml.dll> statement to include definitions for the IExDataObject and IExDataObjectFiles objects.
The following VB.NET sample puts the selected text to the clipboard when the drag and drop operation starts:
Private Sub AxHTML1_OLEStartDrag(ByVal sender As Object, ByVal e As AxEXHTMLLib._IHTMLEvents_OLEStartDragEvent) Handles AxHTML1.OLEStartDrag Dim s As String = AxHTML1.SelText If (Len(s) > 0) Then e.allowedEffects = 1 e.data.SetData(s, 1) End If End Sub
The following C# sample puts the selected text to the clipboard when the drag and drop operation starts:
private void axHTML1_OLEStartDrag(object sender, AxEXHTMLLib._IHTMLEvents_OLEStartDragEvent e) { string s = axHTML1.SelText; if (s.Length > 0) { e.allowedEffects = 1; e.data.SetData(s, EXHTMLLib.exClipboardFormatEnum.exCFText ); } }
The following VFP sample puts the selected text to the clipboard when the drag and drop operation starts:
*** ActiveX Control Event *** LPARAMETERS data, allowedeffects with thisform.HTML1 local s s = .SelText if ( len(s) > 0 ) then allowedeffects = 1 data.SetData( s, 1 ) endif endwith