Hi Guys,
I am dynamically adding controls in my form or container. I need to do something on an event.
Basically I am adding controls to my form and I want that on mousemove I can get that controls location or tag or something.
How can I achieve the same ?
Thanks,
Cheers,
GR
I am dynamically adding controls in my form or container. I need to do something on an event.
Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim P As New PictureBox
P.BackColor = Color.Wheat
Me.Controls.Add(P)
P.Show()
P.Tag = Now.Date
AddHandler P.MouseMove, AddressOf MMove
End Sub
Public Sub MMove(ByVal sender As Object, ByVal e As EventArgs)
' here i want value / tag of picturebox
End Sub
How can I achieve the same ?
Thanks,
Cheers,
GR