Results 1 to 4 of 4

Thread: Mouse pointer change

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2000
    Location
    Tennessee
    Posts
    279

    Mouse pointer change

    Does anyone have an example of changing a mouse pointer to an hourglass while a dataset is being fetched?
    A cynic knows the price of everything but the value of nothing.

  2. #2
    Fanatic Member JPicasso's Avatar
    Join Date
    Aug 2001
    Location
    Kalamazoo, MI
    Posts
    843
    I use
    VB Code:
    1. [formname].activeform.cursor = cursors.waitcursor

    it behaves a little different. I'd experiemnt from there.

    HTH
    Merry Christmas

  3. #3
    Hyperactive Member
    Join Date
    Apr 2001
    Location
    N42 29.340 W71 53.215
    Posts
    422

    Save/change/restore mousepointer?

    In VB6, when I'm going to do something that may take a while, I always do the following:
    VB Code:
    1. Dim MousePtr as Integer
    2.  
    3.     MousePtr = Screen.MousePointer   ' Save current setting
    4.     Screen.MousePointer = vbHourglass
    5.           (do stuff)
    6.     Screen.MousePointer = MousePtr   ' Restore to previous setting

    This works like a charm and ensures that if I have nested changes I don't go setting the pointer back to default prematurely.

    How can I get and save the current cursor state in .NET and then restore that when I'm done playing?

    Thanks, DaveBo
    "The wise man doesn't know all the answers, but he knows where to find them."
    VBForums is one place, but for the really important stuff ... here's a clue 1Tim3:15

  4. #4
    Hyperactive Member
    Join Date
    Apr 2001
    Location
    N42 29.340 W71 53.215
    Posts
    422

    I figured it out

    VB Code:
    1. Dim MousePtr As Object
    2. MousePtr = Me.ActiveForm.Cursor    ' Save current MousePointer
    3. Me.ActiveForm.Cursor = Cursors.WaitCursor   ' Set HourGlass cursor
    4.     ' do stuff
    5. Me.ActiveForm.Cursor = MousePtr    ' Restore previous MousePointer
    "The wise man doesn't know all the answers, but he knows where to find them."
    VBForums is one place, but for the really important stuff ... here's a clue 1Tim3:15

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