Mouse cursor won't stay set. 
Author Message
 Mouse cursor won't stay set.

Hi,
    I'm trying to change the mouse cursor but it doesn't stay to what I set
it at.  The only way I have found to make it somewhat stay is to run a
routine in the mouse move event that changes the cursor to what it should
be.  For example in a menu item click event I change the cursor to a cross
bar and it instantly changes back to the default cursor.  I've tried
changing things in the form_load event, from buttons, from creating a
seperate function to call and changing it.  Nothing makes it stick.  I
definitly have a hole in my logic about how the mouse cursor works in
VB.Net.  Can someone fill me in?  Thanks!  Ken.


Fri, 09 Jan 2004 02:08:08 GMT  
 Mouse cursor won't stay set.


Quote:
> Hi,
>     I'm trying to change the mouse cursor but it doesn't stay to what I
set
> it at.  The only way I have found to make it somewhat stay is to run a

From the docs: (titled "Screen Object Changes in Visual Basic.NET")
In Visual Basic 6.0, changing Screen.MousePointer changed the cursor's
appearance until Screen.MousePointer was changed again.
In Visual Basic.NET, it remains changed only until Windows messages are
processed again (until the next DoEvents call or until the program's
processing is done).

IMO, this is a much better model than that of VB6..we can stop worrying
about when
we should reset the pointer

Merak



Fri, 09 Jan 2004 05:12:43 GMT  
 Mouse cursor won't stay set.
My mind is having a hard time understanding how this works.  Here is my new
problem.  I put a button on the screen.  I assigned Cursors.Cross to
Button1.Cursor in the form load event.  Now the cursor is always a cross.  I
get all the functionality I want by just changing the button's cursor type.
It doesn't just change the cursor when the pointer is over the button, but
through-out the whole form.  This is exactly what I want but it seems silly
to create a hidden button to control the mouse cursor.  It also can't be
correct that setting my form's cursor property only lasts until a DoEvent
runs.  If that were so then the cursor would never show unless I was sure to
change the mouse cursor in each and every active event that could possibly
be run.  I'm obviously not seeing how the framework handles this clearly.
For now I'll stick with the hidden button because it works awesome.  If
anyone has form code they could shoot up here that would be great so I can
see how it is properly implemented.  Ken.


Quote:


> > Hi,
> >     I'm trying to change the mouse cursor but it doesn't stay to what I
> set
> > it at.  The only way I have found to make it somewhat stay is to run a

> From the docs: (titled "Screen Object Changes in Visual Basic.NET")
> In Visual Basic 6.0, changing Screen.MousePointer changed the cursor's
> appearance until Screen.MousePointer was changed again.
> In Visual Basic.NET, it remains changed only until Windows messages are
> processed again (until the next DoEvents call or until the program's
> processing is done).

> IMO, this is a much better model than that of VB6..we can stop worrying
> about when
> we should reset the pointer

> Merak



Fri, 09 Jan 2004 06:48:19 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. 2000 mdb won't stay compiled

2. won't stay compiled

3. ScreenUpdating won't stay deactivated.

4. Controls won't stay put on inherited winform

5. Multiple forms, won't stay in taskbar?

6. Command button won't stay down ??

7. DBGrid text wrap - won't stay wrapped!

8. MaskEdit Control Won't stay 3-D

9. Why printer object won't stay reset to correct font/size

10. Com DLL won't stay in memory

11. Excel Sheet won't stay open

12. Image won't stay loaded

 

 
Powered by phpBB® Forum Software