Does anyone have an example of changing a mouse pointer to an hourglass while a dataset is being fetched?
Printable View
Does anyone have an example of changing a mouse pointer to an hourglass while a dataset is being fetched?
I use
VB Code:
[formname].activeform.cursor = cursors.waitcursor
it behaves a little different. I'd experiemnt from there.
HTH
In VB6, when I'm going to do something that may take a while, I always do the following:
VB Code:
Dim MousePtr as Integer MousePtr = Screen.MousePointer ' Save current setting Screen.MousePointer = vbHourglass (do stuff) Screen.MousePointer = MousePtr ' Restore to previous setting
This works like a charm and ensures that if I have nested changes I don't go setting the pointer back to default prematurely.
How can I get and save the current cursor state in .NET and then restore that when I'm done playing?
Thanks, DaveBo
VB Code:
Dim MousePtr As Object MousePtr = Me.ActiveForm.Cursor ' Save current MousePointer Me.ActiveForm.Cursor = Cursors.WaitCursor ' Set HourGlass cursor ' do stuff Me.ActiveForm.Cursor = MousePtr ' Restore previous MousePointer