CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2001
    Posts
    165

    Mouse Pointer resetting

    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


  2. #2
    Join Date
    May 2000
    Location
    New York, NY, USA
    Posts
    2,878

    Re: Mouse Pointer resetting

    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
    [email protected]
    Iouri Boutchkine
    [email protected]

  3. #3
    Join Date
    Jan 2001
    Posts
    165

    Re: Mouse Pointer resetting

    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


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured