J
John Devlon
Hi,
I've created a form and on the fly several pictureboxes are created...
Dim x As Integer = 0
Dim myCollection As List(Of PictureBox) = New List(Of PictureBox)
Dim Location As Integer = 50
For x = 0 To 5
Dim myBox As PictureBox = New PictureBox
myBox.SetBounds(50, Location * x, 34, 34)
myBox.BackColor = Color.Black
myBox.BringToFront()
myBox.AllowDrop = True
Me.Controls.Add(myBox)
myCollection.Add(myBox)
myBox = Nothing
Next
I would like to use drag and drop to put pictures in the pictureboxes and a
function like this ...
Private Sub picureBox_DragDrop(ByVal sender As System.Object, ByVal e As
System.Windows.Forms.DragEventArgs) Handles PictureBox3.DragDrop
End Sub
But what if I created the pictureboxes on the fly ? I can't use "handles
PictureBox" ...
I propably have the use the sender but how ?
John
I've created a form and on the fly several pictureboxes are created...
Dim x As Integer = 0
Dim myCollection As List(Of PictureBox) = New List(Of PictureBox)
Dim Location As Integer = 50
For x = 0 To 5
Dim myBox As PictureBox = New PictureBox
myBox.SetBounds(50, Location * x, 34, 34)
myBox.BackColor = Color.Black
myBox.BringToFront()
myBox.AllowDrop = True
Me.Controls.Add(myBox)
myCollection.Add(myBox)
myBox = Nothing
Next
I would like to use drag and drop to put pictures in the pictureboxes and a
function like this ...
Private Sub picureBox_DragDrop(ByVal sender As System.Object, ByVal e As
System.Windows.Forms.DragEventArgs) Handles PictureBox3.DragDrop
End Sub
But what if I created the pictureboxes on the fly ? I can't use "handles
PictureBox" ...
I propably have the use the sender but how ?
John