G
Guest
I am trying to show an hourglass mouse cursor and disable the main form
whilst waiting for some activity to finish. The problem I have come across is
that as soon as you disable the main form the cursor returns to the default
arrow.
Does anyone know of an alternative approach ?
It can be easily simulated with a project containing a single form with a
button and timer on as follows :
'-----------------------------------------------------------------------------------------------
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
'>>>This line works as expected showing the hourglass cursor...
Cursor = Cursors.WaitCursor
'>>>As soon as I call the next line the cursor returns to the default
arrow....
Me.Enabled = False
Timer1.Enabled = True
End Sub
Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Timer1.Tick
Timer1.Enabled = False
Me.Enabled = True
Me.Cursor = Cursors.Default
End Sub
'-----------------------------------------------------------------------------------------------
whilst waiting for some activity to finish. The problem I have come across is
that as soon as you disable the main form the cursor returns to the default
arrow.
Does anyone know of an alternative approach ?
It can be easily simulated with a project containing a single form with a
button and timer on as follows :
'-----------------------------------------------------------------------------------------------
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
'>>>This line works as expected showing the hourglass cursor...
Cursor = Cursors.WaitCursor
'>>>As soon as I call the next line the cursor returns to the default
arrow....
Me.Enabled = False
Timer1.Enabled = True
End Sub
Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Timer1.Tick
Timer1.Enabled = False
Me.Enabled = True
Me.Cursor = Cursors.Default
End Sub
'-----------------------------------------------------------------------------------------------