I have a simple VB.NET form that calls a SQL Server Agent Job. My problem is that I am disabling the button for 3 seconds once depressed so the job has time to finish. If I hit the button several times in that 3 seconds, the button continues to function even though disabled....
What am I missing?
Private Sub btnCallJob_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnCallJob.Click
Cursor = Cursors.WaitCursor
BtnCallJob.Enabled = False
'Call routine that runs sql server package and sleep 3 seconds.
Cursor = Cursors.Default
BtnCallJob.Enabled = True