Windows Develop Bookmark and Share   
 index > Windows Forms General > MouseMove: Cursor "slips off / drops" control
 

MouseMove: Cursor "slips off / drops" control

I create:

Label x = new Label()�/span>

+ set the cursor on top of it with Cursor.Position, pointToScreen etc

+ bool drag=true

in order to be dragging the new label immediately.

Note that I’m moving my Label without the mouse being “down�/span>

When I get my label to where I want it : click -> drag= false

This works�.nearly

The mouse tends to accelerate off my control - and effectively drop it -and I have to keep going back to fetch it.

If I implement the new Label slightly differently and use a traditional:

Mousedown event: drag=true etc

Then this doesn’t happen. Note in that case I’m moving without the mouse being “down�/span>

It seems to be the action of physically clicking the control changes the behaviour of the mouse movement.

I can't see from my code that there's any difference between MouseMove when the mouse is down and when it isn't....is acceleration disabled? I've tried constraining movement with Cursor.Clip but this feels like a dead end.

Any help, greatly appreciated.

zaurska  Friday, August 15, 2008 8:20 AM

I emulated a mouse click instead with the help of this:

http://www.csharphelp.com/board2/read.html?f=1&i=32433&t=32432

zaurska  Friday, August 15, 2008 6:45 PM

I emulated a mouse click instead with the help of this:

http://www.csharphelp.com/board2/read.html?f=1&i=32433&t=32432

zaurska  Friday, August 15, 2008 6:45 PM

You can use google to search for other answers

Custom Search

More Threads

• Strange GDI leak in MDI app...
• Call the click event from another form
• synchronize time?!
• SplitterConatiner frame style?
• Setting a Control to use many usercontrols
• Printing Children
• how to draw a rectangle background when the informatio is display using c#
• How to start a form in hidden mode?
• Validation Problem
• Problem with compiling in English and German VS 2005