Hide

SftMask/OCX 7.0 - ActiveX Masked Edit Control

Display
Print

Clear Method, DataObject Object

Clears all data and formats in a DataObject object.

Syntax

VB.NETobject.Clear()
VBobject.Clear
C#.NETvoid object.Clear();
VC++HRESULT object->Clear();
CHRESULT object->raw_Clear();

object

A DataObject object.

Comments

The Clear method clears all data and formats in a DataObject object.

This method is available only for OLE drag sources. If Clear is called from a drop target component, an error is generated.

Examples

VB.NET

Private Sub AxAxSftMask1_DragStarting(ByVal sender As Object, ByVal e As AxSftMaskLib70._ISftMaskEvents_DragStartingEvent) Handles AxSftMask1.DragStarting
    If AxSftMask1.SelLength <> 0 Then
        AxSftMask1.OLEDrag()
    End If
End Sub

Private Sub AxAxSftMask1_OLEStartDrag(ByVal sender As Object, ByVal e As AxSftMaskLib70._ISftMaskEvents_OLEStartDragEvent) Handles AxSftMask1.OLEStartDrag
    e.data.Clear()
    e.data.Files.Add(AxSftMask1.SelText)
    e.data.SetData(Nothing, SftOLEClipboardConstants.sftCFFiles)
    e.allowedEffects = 1 ' vbDropEffectCopy
End Sub

VB6

Private Sub SftMask1_DragStarting(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Single, ByVal y As Single)
    If SftMask1.SelLength <> 0 Then
        SftMask1.OLEDrag
    End If
End Sub

Private Sub SftMask1_OLEStartDrag(Data As SftMaskLib70.DataObject, AllowedEffects As Long)
    Data.Clear
    Data.Files.Add SftMask1.SelText
    Data.SetData , sftCFFiles
    AllowedEffects = vbDropEffectCopy
End Sub

C#

{
    if (axSftMask1.SelLength != 0) {
        axSftMask1.OLEDrag();
    }
}

private void axSftMask1_OLEStartDrag(object sender, AxSftMaskLib70._ISftMaskEvents_OLEStartDragEvent e)
{
    e.data.Clear();
    e.data.Files.Add(axSftMask1.SelText, null);
    e.data.SetData(null, SftOLEClipboardConstants.sftCFFiles);
    e.allowedEffects = 1; //vbDropEffectCopy
}

C++

    if (m_pMask1->SelLength != 0) {
        m_pMask1->OLEDrag();
    }
}

void CProject1Dlg::OnOLEStartDragSftMask1(LPDISPATCH FAR* Data, long FAR* AllowedEffects)
{
    IVDMDataObjectPtr pData = *Data;
    pData->Clear();
    pData->Files->Add(m_pMask1->SelText);
    pData->SetData(vtMissing, _variant_t((long) sftCFFiles));
    *AllowedEffects = DROPEFFECT_COPY;
}

BEGIN_EVENTSINK_MAP(CProject1Dlg, CDialog)
    //{{AFX_EVENTSINK_MAP(CProject1Dlg)

See Also DataObject Object | Object Hierarchy


Last Updated 08/13/2020 - (email)
© 2024 Softel vdm, Inc.