Hey guys, Im having a problem when trying to detect mouse clicks inside a function.
Heres some code, and hopefully you can see what it's doing as its really confusing trying to explain.
Sub ImageFollow(e As System.Windows.Forms.MouseEventArgs, myImage As System.Drawing.Image)
Dim pBox As New PictureBox
While TimerLeft
pBox.Image = myImage
pBox.Parent = PictureBox1
pBox.Size = New System.Drawing.Size(64, 64)
Me.PictureBox1.SizeMode = PictureBoxSizeMode.CenterImage
'DebugTest(TimerLeft)
Select Case MouseButtons
Case Windows.Forms.MouseButtons.Left
' Timer = False
'Case Else
'Call DebugTest("case else")
pBox.Top = MousePosition.Y
pBox.Left = MousePosition.X
Refresh()
End Select
End While
End Sub
TimerLeft is a Global variable, I cant find anyway of not using one.
I also have a TimerTick event that (attempts) to check if mouse button is up or down.
Whats happening is the Form loads, then I try to click/ drag a button, it clicks, then nothing, click again, shows image, it follows but now it wont detect a MouseUp event. So I esentially cant detect when to stop.