17 Апрель 2009

Drag & Drop

Разное |

Drag & Drop

Option Explicit 

Private Sub Form_Load()
    Me.AutoRedraw = True
    Me.OLEDropMode = vbOLEDropManual
End Sub 

'над формой "проносим файл"
Private Sub Form_OLEDragOver(Data As DataObject, Effect As Long, Button As Integer, Shift As Integer, X As Single, Y As Single, State As Integer)
    Me.Cls
    Me.Print "Список перетаскиваемых файлов:"
    Dim File As Variant
    For Each File In Data.Files
        Me.Print File
    Next File
End Sub 

'"отпускаем файл" на форму
Private Sub Form_OLEDragDrop(Data As DataObject, Effect As Long, Button As Integer, Shift As Integer, X As Single, Y As Single)
    Me.Cls
    Me.Print "Список полученных файлов:"
    Dim File As Variant
    For Each File In Data.Files
        Me.Print File
    Next File
End Sub


Оставить комментарий

Я не робот.