Change Cursor To Hourglass

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • wil1cad2
    New Member
    • Feb 2008
    • 2

    Change Cursor To Hourglass

    I'm using VB studio 2005. Pls help
    to change cursor to HourGlass when u press a button and wait for calcualtion
    the result.

    Ex: If btnCalculate.En abled = True Then
    Screen.MousePoi nter = vbHourglass
    Else
    Screen.MousePoi nter = vbDefault
    End If
    I got some thought above but doesn't work.
    also some hint from instructor:
    Windows.Forms.C ursor.Current = Cursors.WaitCur sor
    Thank you.
  • daniel aristidou
    Contributor
    • Aug 2007
    • 494

    #2
    Um try
    me.cursor instead
    Also just a question......W hy hourglass when button enabled not when calculating?
    I wopuld have posted the code....under click
    and the defualt cursor after the calculation code

    Comment

    • Killer42
      Recognized Expert Expert
      • Oct 2006
      • 8429

      #3
      The Screen.MousePoi nter method is from VB6 (and earlier). I believe it's handled differently in VB2005.

      Comment

      • wil1cad2
        New Member
        • Feb 2008
        • 2

        #4
        Originally posted by daniel aristidou
        Um try
        me.cursor instead
        Also just a question......W hy hourglass when button enabled not when calculating?
        I wopuld have posted the code....under click
        and the defualt cursor after the calculation code
        yes u are right it is when calculating.
        so what is the code suggestion.
        Thanks.

        Comment

        • Killer42
          Recognized Expert Expert
          • Oct 2006
          • 8429

          #5
          I don't think we know enough about your code.

          But the general idea is to turn on the hourglass (and perhaps issue a DoEvents to ensure Windows updates the display) before starting your long-running calculation. Then you set the mousepointer back to normal when the calculation is finished.

          Comment

          • DaveTheBari
            New Member
            • Nov 2006
            • 3

            #6
            There is a 'Do' command to bring up the hourglass:-
            DoCmd.Hourglass = True
            To return to the default cursor:-
            DoCmd.Hourglass = False
            Cheers
            Dave

            Comment

            • DaveTheBari
              New Member
              • Nov 2006
              • 3

              #7
              Further to my last -
              Maybe that's not a lot of use to you - I was searching for a solution to a problem in VB inside MS Access, so had Access on the brain. That DoCmd thing is an Access facility that operates in VB.
              Dave

              Comment

              Working...