mooman_fl
Centurion
Greetings all,
Needing to be able to drag and drop files or even weblinks from Explorer or a browser into a picturebox and get the string for the path or text of the link. I think I could figure out how to get the text if I could just figure out how to accomplish this drag and drop feat. Have searched the web for examples figuring there would be one out there but they all deal with dragging and dropping from one picturebox to another, or even to the form itself. I just want it limited to the picturebox control on the form, and the dragging will definitely be coming from outside the program.
Any pointers or examples (if it is simple and won't take up too much of your time) would be helpful.
Thanks in advance.
EDIT:
Decided to edit and give an example of what I tried that didn't work based on the little I could find on the web...
Needing to be able to drag and drop files or even weblinks from Explorer or a browser into a picturebox and get the string for the path or text of the link. I think I could figure out how to get the text if I could just figure out how to accomplish this drag and drop feat. Have searched the web for examples figuring there would be one out there but they all deal with dragging and dropping from one picturebox to another, or even to the form itself. I just want it limited to the picturebox control on the form, and the dragging will definitely be coming from outside the program.
Any pointers or examples (if it is simple and won't take up too much of your time) would be helpful.
Thanks in advance.
EDIT:
Decided to edit and give an example of what I tried that didn't work based on the little I could find on the web...
Code:
Public Class Form1
Public Sub New()
' This call is required by the Windows Form Designer.
InitializeComponent()
Me.pbxRoboInstall.AllowDrop = True
End Sub
Private Sub pbxRoboInstall_DragDrop(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles pbxRoboInstall.DragDrop
Dim s() As String = e.Data.GetData("FileDrop", False)
Dim i As Integer
For i = 0 To s.Length - 1
MessageBox.Show(s(i).ToString)
Next i
End Sub
End Class
Last edited: