• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 730
  • Last Modified:

Don't want hourglass

How do I prevent the mouse pointer from showing an hourglass when the program is updating WebBrowser controls in the background.  My users get very concerned when their arrow changes to an hourglass then back to an arrow and so forth.
0
hrolsons
Asked:
hrolsons
1 Solution
 
zorvek (Kevin Jones)ConsultantCommented:
You can try setting the cursor to something specific but that's going to annoy your users even more when they are expecting an insertion line or some other cursor based on what they are doing at the moment.

You're best bet is to create a second workbook to do the work, open it in a separate hidden instance of Excel and let it do the work. This will have the additional advantage of not sucking up application cycles where the active workbook is being used.

Kevin
0
 
hrolsonsAuthor Commented:
This is in VB6, not Excel.
0
 
zorvek (Kevin Jones)ConsultantCommented:
Oops! Sorry about that!

Then set the cursor to whatever you want it to be but you will have to maintain it as the use navigates around your application. For example, if they edit a text field you will have to adjust it. I'm pretty sure if you set the cursor it will stay that way until you unset it.

But I don't think you can keep the browser object from trying to manipulate it.

Kevin
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
zorvek (Kevin Jones)ConsultantCommented:
A couple of ideas.

You can also spawn a separate hidden process to do your work in VB6. I like this idea the best. I've done it myself. One example was when I wanted to download an application update from a webservice without impacting the application. A mutex, a pipe to communicate, and a separate application project and your done.

There is also this trick of setting the cursor to something you want while the ie object is being manipulated. Here is some sample code forcing the cursor to be an hourglass. I suspect you can do the same thing but with a different desired cursor like an arrow. But, again, keep in mind that the user may be expecting some other cursor and the arrow will be just as confusing as the hourglass.

Title: http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Controls/Q_20747434.html
Link: http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Controls/Q_20747434.html

Kevin
0
 
aikimarkCommented:
If you can limit the pointer to that part of the form that isn't the web browser, your user might not see the hourglass pointer.  However, that type of pointer limitation can be as awkward as the hourglass.

You might place a transparent, or snapshot image, object over the web browser during the update process.  When the update process completes, you swap the ZORDER of the two objects.
0
 
Chris Raisin(Retired Analyst/Programmer)Commented:

You could try this :
   
  Do while oWebBrowser.busy()  'oWebBrowser is name of your Browser object
     Screen.mousepointer = vbDefault
     DoEvents  
  Loop

Hopefully it is not too processor hungry.....
0
 
ArkCommented:
Agree with aikimark. WebBrowser doesn't pay attention on Form.MousePointer and even on Screen.MousePointer - it uses it's own cursor.
You can also try to change cursor in webbrowser document
WebBrowser.Document.Body.Style.Cursor="arrow" (not sure but AFAIK 'arrow' us available on IE6+ only). You can also try to 'disable' webbrowser. Though WebBrowser haven't Enabled property, you can put it into Frame or Picture box and disable them when WB updating
0
 
Chris Raisin(Retired Analyst/Programmer)Commented:
I would think that while the processor is acting upon WebBrowser Controls, then the MousePointer would have attributes associated with that control and so (while the WebBrowser control is active) the pointer would be acting on instructions from Visual Basic, not from the Windows System itself (that is why it flicks back and forth, as each process in the entire system runs, the mousepointer takes on the attributes of the  currently running process).  Did you try my "do while busy" suggestion?
0
 
Chris Raisin(Retired Analyst/Programmer)Commented:
By the way, you will have to change the code to reflect the names of your webbrowser control etc.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now