Hide

SftMask/OCX 7.0 - ActiveX Masked Edit Control

Display
Print

DragDrop2 Sample (VB6)

This sample illustrates using an OLE drop target.

This is not an executable sample, so a complete project is not provided. These statements are intended to show basic concepts and the syntax used.

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)
    If Data.GetFormat(sftCFFiles) Then
        If Data.Files.Count > 1 Then
            MsgBox ("Only one file at a time please.")
        Else
            SftMask1.Text = Data.Files.Item(1)
        End If
    End If
End Sub

Private Sub SftMask1_OLEDragOver(Data As SftMaskLib70.DataObject, TargetChar As Long, Effect As Long, Button As Integer, Shift As Integer, x As Single, y As Single, State As SftMaskLib70.SftMaskOLEDragOverConstants)
    If TargetChar < 0 Then
        ' Outside edit control (on caption)
        Effect = vbDropEffectNone
    Else
        ' Inside edit control
        If Data.GetFormat(sftCFFiles) Then
            ' OK, we have a file format
        Else
            ' No file format
            Effect = vbDropEffectNone
        End If
    End If
End Sub

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