Visual Basic

Moderators: None (Apply to moderate this forum)
Number of threads: 18013
Number of posts: 55386

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Changing Mouse Icon in runtime Posted by capone888 on 9 Feb 2005 at 3:46 PM
Here's an easy one that is giving me some trouble.
I want to click a command button to load a new form. The new form has a longer than usual load time (roughly 5 seconds). Instead of having my users click the command button to load the next form, and sit there wondering for 5 seconds if they actually hit the command button or not, I want to change the mouse icon to the common hourglass icon common to all Win machines. Then, when the form finally loads, I want to change the mouse icon back to the common arrow pointer.
Could someone supply me with a code snippet on how to make this happen. I am assuming it is fairly easy. A URL to a page that has a tutorial on the topic would also be welcomed. The only articles I have found so far are on using custom icons. I tried to convert those articles to my own needs, but I am probably doing something wrong. Could anyone help? Thanks!
Report
Re: Changing Mouse Icon in runtime Posted by ganesh4u on 9 Feb 2005 at 11:58 PM
It's very simple

use timer control when user clicks cmd button change forms.mouse icon property to hourglass and after 5 secs (use timer controls property)change it to default.
Ganesh :)

Report
Re: Changing Mouse Icon in runtime Posted by Mike_AB1 on 10 Feb 2005 at 6:22 AM
: Here's an easy one that is giving me some trouble.
: I want to click a command button to load a new form. The new form has a longer than usual load time (roughly 5 seconds). Instead of having my users click the command button to load the next form, and sit there wondering for 5 seconds if they actually hit the command button or not, I want to change the mouse icon to the common hourglass icon common to all Win machines. Then, when the form finally loads, I want to change the mouse icon back to the common arrow pointer.
: Could someone supply me with a code snippet on how to make this happen. I am assuming it is fairly easy. A URL to a page that has a tutorial on the topic would also be welcomed. The only articles I have found so far are on using custom icons. I tried to convert those articles to my own needs, but I am probably doing something wrong. Could anyone help? Thanks!
:

You can do it this way:

Private Sub Form_Load()
Screen.MousePointer = vbHourglass
'''
'''
'''
Screen.MousePointer = vbDefault

End Sub

Report
Re: Changing Mouse Icon in runtime Posted by capone888 on 10 Feb 2005 at 1:05 PM
Thanks!! Both your suggestions worked great.



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.