Results 1 to 16 of 16

Thread: Hourglass

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2001
    Posts
    302

    Hourglass

    I'm trying to change the cursor to an hourglass. It used to work, but it doesn't anymore... Any ideas?

    Screen.MousePointer = vbHourglass 'vbDefault

  2. #2
    PowerPoster Pasvorto's Avatar
    Join Date
    Oct 2002
    Location
    Minnesota, USA
    Posts
    2,951
    That looks right. What happens when that line of code is executed?

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2001
    Posts
    302
    nothing, the cursor doesn't change.

  4. #4
    Hyperactive Member VB IT's Avatar
    Join Date
    Feb 2003
    Posts
    381

    Unhappy Try This

    Your Code Is working on my Computer
    Try these
    VB Code:
    1. Me.MousePointer = vbHourglass
    2.  
    3. Or
    4.  
    5. Me.MousePointer = 11
    Sorry for Bad English.

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2001
    Posts
    302
    i tried both...

    it works on the form load...

    it's weird because the "Screen.MousePointer"=11... It's just not changing the cursor!

  6. #6
    PowerPoster
    Join Date
    Aug 2000
    Location
    IN SILENCE
    Posts
    6,441

    Well

    Are you using LockWindowUpdate API call withing you app?
    Remaining quiet down here !!!

    BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....

  7. #7

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2001
    Posts
    302
    no.. this only started when I added a class module. I removed it for testing, and it still doesn't work...

  8. #8
    Frenzied Member RudyL's Avatar
    Join Date
    Mar 2001
    Location
    Chicago
    Posts
    1,519
    Screen.MousePointer = vbHourglass 'vbDefault
    and

    Me.MousePointer = vbHourglass
    Are 2 different things. One changes the mouse pointer on the form only, the other changes it on the desktop.. Exactly which one are you trying to accomplish?

    Rudy
    10 different ways to skin a cat and amazingly enough each and every one has the same result, the cat gets skinned! The same can be applied to code, so be nice and accept each others "preferences".

  9. #9

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2001
    Posts
    302
    i want to change the the cursor for the form... while the form is working... i had tried me.MousePointer... doesn't work either...

    it's weird because, it stays at the hourglass when i do not reset it to the defaut (at the end)... I thought that maybe it was getting reset back to default, so I put in a break point at the first line after changing the mouse pointer. it never changes...

    before the set, Screen.MousePointer =0
    after the set, Screen.MousePointer =11, but it doesn't change on the screen!!!

    Screen.MousePointer = vbHourglass 'vbDefault

    Label7.Caption = edNameFilter.text
    List1.Clear
    lblItemCount.Caption = 0

    ' Disable the start button and enable the stop button
    btnSearch.Enabled = False
    btnStopSearch.Enabled = True
    Call NWDir1.Search(edNameFilter.text & "*", edClassFilter.text, cbSearchScope.ListIndex + 1, edStartContext.text)
    edNameFilter.SetFocus
    edNameFilter.text = ""
    Me.MousePointer = vbDefault 'vbHourglass

  10. #10
    Fanatic Member demotivater's Avatar
    Join Date
    Jun 2002
    Location
    is everything
    Posts
    627
    Have you tried adding a form.refresh after you change the mouse pointer?

    VB Code:
    1. mousepointer = vbhoruglass
    2. me.refresh

    Also, my mouse pointer rarely changes while testing in VB, but when I run the executable it usually changes as it should.

  11. #11
    Hyperactive Member Simon Caiger's Avatar
    Join Date
    Aug 2000
    Location
    Rugby, England
    Posts
    377
    I have had the same problem.
    Try putting the cursor change code in the form.activate.
    Simon Caiger

    Documentation is like sex; when it's good, it's very, very good, and when it's bad, it's better than nothing.

  12. #12

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2001
    Posts
    302
    i had, and it hadn't made a difference... now it is comming on, but it does't go back to the default...

    i'm going to restart my PC

  13. #13
    Hyperactive Member Simon Caiger's Avatar
    Join Date
    Aug 2000
    Location
    Rugby, England
    Posts
    377
    Weird one,

    I had this problem the other day. The only way I could get the hourglass to appear was by putting the cursor change in the form.activate. It wouldn't change in the form.load nor in a timer that was kicking in a while after the form was loaded.
    Simon Caiger

    Documentation is like sex; when it's good, it's very, very good, and when it's bad, it's better than nothing.

  14. #14
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687
    Originally posted by Simon Caiger
    Weird one,

    I had this problem the other day. The only way I could get the hourglass to appear was by putting the cursor change in the form.activate. It wouldn't change in the form.load nor in a timer that was kicking in a while after the form was loaded.
    Actually it makes sense if you think about it. The Form_Load event fires when the form loads into memory.... but it may not be visible yet. Once it does become visible, the Form_Activate events fires, and then the mouse pointer can change.
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  15. #15
    Hyperactive Member Simon Caiger's Avatar
    Join Date
    Aug 2000
    Location
    Rugby, England
    Posts
    377
    I agree,

    What I couldn't explan was why the houglass didn't appear when I tried to change the cursor in a timer that fired some seconds after the form loaded.
    Simon Caiger

    Documentation is like sex; when it's good, it's very, very good, and when it's bad, it's better than nothing.

  16. #16
    Frenzied Member RudyL's Avatar
    Join Date
    Mar 2001
    Location
    Chicago
    Posts
    1,519
    You need to put the code in the event that you want the mouse pointer to change...

    i.e.

    form1.mousepointer = vbhourglass
    doevents

    You should use a do events afterwards to make sure windows paints the screen (99% of the time not a problem.. but..)

    If you put it in the load event is will only happen when the form is loaded into memory. To get it to reload you need to "unload" the form the laod it again..
    10 different ways to skin a cat and amazingly enough each and every one has the same result, the cat gets skinned! The same can be applied to code, so be nice and accept each others "preferences".

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