While were on the subject, why does the code not work if the code in the handlers is switched around (swapped)?
Original code left in comments.
Code:
' Move the button to (10, 10), disable tmrMoveLeft, and enable tmrMoveRight.
Private Sub tmrMoveLeft_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tmrMoveLeft.Tick
'tmrMoveLeft.Enabled = False
'tmrMoveRight.Enabled = True
tmrMoveLeft.Enabled = True
tmrMoveRight.Enabled = False
btnStop.Left = 10
btnStop.Top = 10
End Sub
' Move the button to (200, 200), disable tmrMoveRight, and enable tmrMoveLeft.
Private Sub tmrMoveRight_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tmrMoveRight.Tick
'tmrMoveLeft.Enabled = True
'tmrMoveRight.Enabled = False
tmrMoveLeft.Enabled = False
tmrMoveRight.Enabled = True
btnStop.Left = 200
btnStop.Top = 200
End Sub
It only seems to work once; to move the button to (10,10), but then it stops.
Being completely new to
VB programming, I dont know how to step through the code; or for that matter know what order it goes about executing.
Thanks for any help.