Type | Description | |||
exOLEDropModeEnum | An exOLEDropModeEnum expression that indicates the OLE Drag and Drop mode. |
The following VB sample puts the selected text to the clipboard when the drag and drop operation starts ( The OLEDropMode property is exOLEDropAutomatic ):
With Expression1 .OLEDropMode = exOLEDropManual End With
Private Sub Expression1_OLEStartDrag(ByVal Data As EXPRESSIONLibCtl.IExDataObject, AllowedEffects As Long) Dim s As String s = Expression1.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:
m_expression.SetOLEDropMode( 1 );
void OnOLEStartDragExpression1(LPDISPATCH Data, long FAR* AllowedEffects) { CString s( m_expression.GetSelText() ); if ( s.GetLength() > 0 ) { *AllowedEffects = 1; /*exOLEDropEffectCopy*/ if ( EXPRESSIONLib::IExDataObjectPtr spData( Data ) ) spData->SetData( COleVariant( s ), COleVariant( long(EXPRESSIONLib::exCFText) ) ); } }
The C++ sample uses the #import <expression.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:
With AxExpression1 .OLEDropMode = EXPRESSIONLib.exOLEDropModeEnum.exOLEDropManual End With
Private Sub AxExpression1_OLEStartDrag(ByVal sender As Object, ByVal e As AxEXPRESSIONLib._IExpressionEvents_OLEStartDragEvent) Handles AxExpression1.OLEStartDrag Dim s As String = AxExpression1.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:
axExpression1.OLEDropMode = EXPRESSIONLib.exOLEDropModeEnum.exOLEDropManual;
private void axExpression1_OLEStartDrag(object sender, AxEXPRESSIONLib._IExpressionEvents_OLEStartDragEvent e) { string s = axExpression1.SelText; if (s.Length > 0) { e.allowedEffects = 1; e.data.SetData(s, EXPRESSIONLib.exClipboardFormatEnum.exCFText ); } }
The following VFP sample puts the selected text to the clipboard when the drag and drop operation starts:
with thisform.Expression1 .OLEDropMode = 1 endwith
*** ActiveX Control Event *** LPARAMETERS data, allowedeffects with thisform.Expression1 local s s = .SelText if ( len(s) > 0 ) then allowedeffects = 1 data.SetData( s, 1 ) endif endwith