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
Printable View
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
That looks right. What happens when that line of code is executed?
nothing, the cursor doesn't change. :(
Your Code Is working on my Computer :confused:
Try these
VB Code:
Me.MousePointer = vbHourglass Or Me.MousePointer = 11
i tried both...
it works on the form load...
it's weird because the "Screen.MousePointer"=11... It's just not changing the cursor!
Are you using LockWindowUpdate API call withing you app?
no.. this only started when I added a class module. I removed it for testing, and it still doesn't work...
andQuote:
Screen.MousePointer = vbHourglass 'vbDefault
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?Quote:
Me.MousePointer = vbHourglass
Rudy
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
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.
I have had the same problem.
Try putting the cursor change code in the form.activate.
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 :)
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.Quote:
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.
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.
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..