Click to See Complete Forum and Search --> : Mouse Pointer resetting


Kdev
March 15th, 2001, 12:01 PM
I have a method that takes approximately 65 seconds to complete and I set the mouse pointer to vbHourGlass then I call DoEvents and finally the method that takes the significant amount of time. In this method there are message boxes that the user must respond to. After responding to the message box the pointer is now back to the standard arrow even though the method is still processing. How can I keep my mouse pointer set to the Busy pointer while processing my method?

-K

Iouri
March 15th, 2001, 12:15 PM
Usually msgbox does not change pointer (when you move it away from the msgbox). In case that your pointer is changing after each msgbox, set it again to vbHoutglass after each msg

Screen.Mousepointer = vbHourglass
While ... Do
.....
msgbox
Screen.Mousepointer = vbHourglass
.....
msgbox
Screen.Mousepointer = vbHourglass
.....
Loop
Screen.Mousepointer = vbDefault


Iouri Boutchkine
iouri@hotsheet.com

Kdev
March 15th, 2001, 01:26 PM
Using Screen.MousePointer I did get it to work following your example however I think that this is a poor way to 'have' to do this.

The way I originally wrote this I had the click event for the button set the Form.MousePointer to vbHourGlass, then call the function that takes a long time and finally reset the pointer to an arrow.

I think that the function doing the work should not 'have' to do anything with the mouse pointer but maybe there is no way around this as I am new to such long processing functions and have never had to set the mouse pointer.

In sum: thanks again Iouri I can always count on good code from you to work well.

-K