Hide

SftMask/OCX 7.0 - ActiveX Masked Edit Control

Display
Print

DragDrop3 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.

' Shows an OLEDragDrop event handler that accepts text data
' 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
        SftMask1.SelText = S
    Else
        Effect = vbDropEffectNone
    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(sftCFText) Then
            ' OK, we have a text format
        Else
            ' No text format
            Effect = vbDropEffectNone
        End If
    End If
End Sub

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