Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

changing mouse pointers 1

Status
Not open for further replies.

49er

Programmer
Aug 24, 2000
38
0
0
US
During long processing operations, I want to change the mouse pointer to an hourglass.
Code:
screen.mousepointer = vbhourglass
When the processing is finished set the mouse back to the default.
Code:
screen.mousepointer = vbdefault

However, the mouse icon does not change as anticipated(the processing works fine). What am I missing to get the desired behavior I am looking for? Thanks.
 
Try changing the screen.mousepointer=vbArrow instead of screen.mousepointer=vbDefault.


Hope this works for you

reidfl
 
Actually, that is the code I have. I used vbDefault to generalize it a bit. Any other suggestions?
 
Is the mousepointer even changing to the hourglass?

Also, how long is your process?

reidfl
 
Hi,

The problem is probabply that the program yield to other processes (like updating the mousepointer icon).

Try:
----------------------------------------
MyForm.mousepointer = vbhourglass
MyForm.refresh
----------------------------------------

Note that here it is only when the mouse is over the MyForm that the mousepointer is set to hourglass, which is usually what you want.
If this dosen't solve the problem try:
----------------------------------------
MyForm.mousepointer = vbhourglass
do events 'yield for other processes
----------------------------------------
Which should do the trick.

Some don't like Do Events, because you never know what happens (e.g. if an other program writes to the file that you are reading from). I guess that it depends on the program you are writing and how much it interact with other systems.

Sunaj
 
Thanks to both of you for your suggestions. Sunaj, it appears that refresh method did the trick. However, suppose you wanted to change the mousepointer on the screen object rather than the form. How would you do that since the screen object does not contain a refresh method? thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top