I'd like to send a reference to a type with a dragdrop routine, but can't get it to work. Any thoughts? Here's the code I'm using:
Code:
Public Class Form1
Dim s As Type
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.PictureBox1.AllowDrop = True
End Sub
Private Sub PictureBox1_DragDrop(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles PictureBox1.DragDrop
Dim f As Type
f = e.Data.GetData(GetType(Type))
Debug.Print(f Is Nothing) 'returns True. How do I extract the Type from e.Data?
End Sub
Private Sub PictureBox1_DragEnter(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles PictureBox1.DragEnter
e.Effect = DragDropEffects.Copy
End Sub
Private Sub Button2_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Button2.MouseMove
If e.Button = Windows.Forms.MouseButtons.Left Then
s = GetType(class1)
Button1.DoDragDrop(s, DragDropEffects.Copy)
End If
End Sub
End Class
Public Class class1
Dim x As Long
End Class