Drag file to a form, and get its full path

Discussion in 'Programming' started by movvadinesh, Feb 2, 2008.

  1. #1
    Check this one guyz , if you like it or have any problems reply me




    If you drag for example c:\autoexec.bat and c:\setup.ini to your form, there will be printed on the form

    c:\autoexec.bat

    c:\setup.ini

    You can do the same with other control, for example, let the user drag files to picture box, list box and so on.



    Preparations



    Set the Form OLEDropMode Property to 1 - manual



    Form Code



    Private Sub Form_OLEDragDrop(Data As DataObject, Effect As Long , _

    Button As Integer, Shift As Integer, X As Single, Y As Single )

    For i = 1 To Data.Files.Count

    Print Data.Files(i)

    Next i

    End Sub
     
    movvadinesh, Feb 2, 2008 IP