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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to refresh hourglass? 1

Status
Not open for further replies.

tbhat

Programmer
Jun 20, 2001
3
US
Hello,

Our application is written in VB. There is a menu item called 'Installed pricefiles'. When clicked, it loads a form 'frmAPfiles.frm'. This basically extract the price files from the system and display it. So this process may take around 10 seconds. I want to change the mousepointer to hourglass during this period and when the form is completely loaded mousepointer should come back to default.

I tried with screen.MousePointer = vbhourglass/vbdefault. I also tried with screen.MousePointer = 11/0. But the mousepointer is not refreshed untill the form 'frmAPfiles' is loaded.

This is how my code looks
When the user clicks on 'Installed price files' menu item :
Code:
Case InstlPricefilesID
            frmAPfiles.MousePointer = vbHourglass
            DoInstlPricefiles

DoInstlPricefiles is written in the APfiles.bas file :
Code:
Sub DoInstlPricefiles()
            avl_retcode = retrievePriceFiles(avl_ccode, avl_modal, avl_gsaflag, avl_opstring, avl_opsize)
            'format the output here
             .............
             ................  
            frmAPfiles.MousePointer = vbDefault           
            ' form is displayed here
            frmAPfiles.Show vbModal
End Sub

Mousepointer is not seems to be changed to hourglass as I am changing back the Mousepointer to default before frmAPfiles.Show vbModal. If I give vbDefault statement after frmAPfiles.Show vbModal then, the mousepointer will remain as hourglass.

So please let me know how can I refresh the mousepointer (to display hourglass) when the menu item is clicked. It is not automatically refreshed.

Thank you
TBhat
 
frmAPFiles is not displayed until you have already changed the pointer back to default.
the line
frmAPFiles.MousePointer = vbHourGlass
only changes the MousePointer on the frmAPFiles form. Since that form is not yet displayed you don't see the hourglass. Instead of changing the frmAPFiles mousepointer change the mousepointer for the calling form (the one with the menu). Assuming it is named frmMenu it would look like this:

Case InstlPricefilesID
frmMenu.MousePointer = vbHourglass
frmMenu.Refresh
DoInstlPricefiles


DoInstlPricefiles is written in the APfiles.bas file :

Sub DoInstlPricefiles()
avl_retcode = retrievePriceFiles(avl_ccode, avl_modal, avl_gsaflag, avl_opstring, avl_opsize)
'format the output here
.............
................
frmMenu.MousePointer = vbDefault
frmMenu.Refresh
' form is displayed here
frmAPfiles.Show vbModal
End Sub



Ruairi

Could your manufacturing facility benefit from real time process monitoring? Would you like your employees to be able to see up to the minute goal and actual production?
For innovative, low cost solutions check out my website.
 
I am sorry, actually the menu is created using C++. I don't think we have any objects at that instance to refresh the mousepointer.

Is there anyway I can change the mousepointer if the menu created using C++ and rest of the application in VB?

Appreciate if you could help me on this.

Regards
tbhat
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top