Hide

SftMask/OCX 7.0 - ActiveX Masked Edit Control

Display
Print

OLEDropMode Property, SftMask Object

Defines OLE drop support.

Syntax

Get

VB.NETMode = object.OLEDropMode As SftMaskOLEDropModeConstants
VBMode = object.OLEDropMode As SftMaskOLEDropModeConstants
C#.NETSftMaskOLEDropModeConstants Mode = object.OLEDropMode;
VC++enum SftMaskOLEDropModeConstants Mode = object->OLEDropMode;
enum SftMaskOLEDropModeConstants Mode = object->GetOLEDropMode();
CHRESULT object->get_OLEDropMode(enum SftMaskOLEDropModeConstants* Mode);

Put

VB.NETobject.OLEDropMode = Mode As SftMaskOLEDropModeConstants
VBobject.OLEDropMode = Mode As SftMaskOLEDropModeConstants
C#.NETSftMaskOLEDropModeConstants object.OLEDropMode = Mode;
VC++enum SftMaskOLEDropModeConstants object->OLEDropMode = Mode;
void object->PutOLEDropMode(enum SftMaskOLEDropModeConstants Mode);
CHRESULT object->put_OLEDropMode(enum SftMaskOLEDropModeConstants Mode);

object

A SftMask object.

Mode

Defines whether the control can act as an OLE drop target.

ModeValueDescription
OLEDropSftMaskNone0The control is not a valid drop target.
OLEDropSftMaskManual1The control is a valid drop target and triggers the OLE drop events, allowing the application to handle the OLE drop operation.
OLEDropSftMaskAutomatic2The control is a valid drop target and automatically accepts the (text) data dropped on the control.

Comments

The OLEDropMode property defines OLE drop support.

If the control is a valid drop target (OLEDropSftMaskManual), the events OLEDragOver and OLEDragDrop occur when an item is dragged over the control or when an item is dropped.

Examples

VB.NET

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    AxSftMask1.Caption.SizePercent = 33
    AxSftMask1.Caption.Text = "&Filename:"
    AxSftMask1.Mask = ""
    AxSftMask1.MaxLength = 300
    AxSftMask1.PromptUnderline = False
    AxSftMask1.OLEDropMode = SftMaskOLEDropModeConstants.OLEDropSftMaskManual
End Sub

Private Sub AxAxSftMask1_OLEDragDrop(ByVal sender As Object, ByVal e As AxSftMaskLib70._ISftMaskEvents_OLEDragDropEvent) Handles AxSftMask1.OLEDragDrop
    Dim S As String
    If e.data.GetFormat(SftOLEClipboardConstants.sftCFText) Then
        S = e.data.GetData(SftOLEClipboardConstants.sftCFText)
        AxSftMask1.SelStart = e.targetChar
        AxSftMask1.SelText = S
    Else

VB6

' being dropped on the Masked Edit control.

Private Sub Form_Load()
    SftMask1.Caption.SizePercent = 33
    SftMask1.Caption.Text = "&Filename:"
    SftMask1.Mask = ""
    SftMask1.MaxLength = 300
    SftMask1.PromptUnderline = False
    SftMask1.OLEDropMode = OLEDropSftMaskManual
End Sub

Private Sub SftMask1_OLEDragDrop(Data As SftMaskLib70.DataObject, TargetChar As Long, Effect As Long, Button As Integer, Shift As Integer, x As Single, y As Single)
    Dim S As String
    If Data.GetFormat(sftCFText) Then
        S = Data.GetData(sftCFText)
        SftMask1.SelStart = TargetChar

C#

private void Form1_Load(object sender, System.EventArgs e)
{
    axSftMask1.Caption.SizePercent = 33;
    axSftMask1.Caption.Text = "&Filename:";
    axSftMask1.Mask = "";
    axSftMask1.MaxLength = 300;
    axSftMask1.PromptUnderline = false;
    axSftMask1.OLEDropMode = SftMaskOLEDropModeConstants.OLEDropSftMaskManual;
}

private void axSftMask1_OLEDragDrop(object sender, AxSftMaskLib70._ISftMaskEvents_OLEDragDropEvent e)
{
    string s;
    if (e.data.GetFormat((short) SftOLEClipboardConstants.sftCFText)) {
        s = (string) e.data.GetData(SftOLEClipboardConstants.sftCFText);
        axSftMask1.SelStart = e.targetChar;

C++

    m_pMask1 = m_Mask1.GetControlUnknown();
    _ASSERT(m_pMask1 != NULL);

    m_pMask1->Caption->SizePercent = 33;
    m_pMask1->Caption->Text = _T("&Filename:");
    m_pMask1->Mask = _T("");
    m_pMask1->MaxLength = 300;
    m_pMask1->PromptUnderline = VARIANT_FALSE;
    m_pMask1->OLEDropMode = OLEDropSftMaskManual;

    return TRUE;
}

void CProject1Dlg::OnOLEDragDropSftMask1(LPDISPATCH FAR* Data, long FAR* TargetChar, long FAR* Effect, short FAR* Button, short FAR* Shift, float FAR* x, float FAR* y)
{
    IVDMDataObjectPtr pData = *Data;

See Also SftMask Object | Object Hierarchy


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