|
-
Apr 28th, 2003, 07:34 AM
#1
Thread Starter
Hyperactive Member
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
-
Apr 28th, 2003, 07:38 AM
#2
PowerPoster
That looks right. What happens when that line of code is executed?
-
Apr 28th, 2003, 07:47 AM
#3
Thread Starter
Hyperactive Member
nothing, the cursor doesn't change.
-
Apr 28th, 2003, 07:53 AM
#4
Hyperactive Member
Try This
Your Code Is working on my Computer
Try these
VB Code:
Me.MousePointer = vbHourglass
Or
Me.MousePointer = 11
-
Apr 28th, 2003, 08:01 AM
#5
Thread Starter
Hyperactive Member
i tried both...
it works on the form load...
it's weird because the "Screen.MousePointer"=11... It's just not changing the cursor!
-
Apr 28th, 2003, 08:04 AM
#6
PowerPoster
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....
-
Apr 28th, 2003, 08:06 AM
#7
Thread Starter
Hyperactive Member
no.. this only started when I added a class module. I removed it for testing, and it still doesn't work...
-
Apr 28th, 2003, 08:12 AM
#8
Frenzied Member
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".
-
Apr 28th, 2003, 08:28 AM
#9
Thread Starter
Hyperactive Member
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
-
Apr 28th, 2003, 08:36 AM
#10
Fanatic Member
Have you tried adding a form.refresh after you change the mouse pointer?
VB Code:
mousepointer = vbhoruglass
me.refresh
Also, my mouse pointer rarely changes while testing in VB, but when I run the executable it usually changes as it should.
-
Apr 28th, 2003, 08:42 AM
#11
Hyperactive Member
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.
-
Apr 28th, 2003, 08:43 AM
#12
Thread Starter
Hyperactive Member
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
-
Apr 28th, 2003, 08:52 AM
#13
Hyperactive Member
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.
-
Apr 28th, 2003, 08:59 AM
#14
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.
-
Apr 28th, 2003, 09:08 AM
#15
Hyperactive Member
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.
-
Apr 28th, 2003, 09:21 AM
#16
Frenzied Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|