Reputation: 5884
I did something like scrollbar from Control
. Everything is fine, but when cursor leaves control area, OnMouseMove
is not received anymore.
When you use standard windows scrollbar, you can use it even if mouse cursor is outside the control's surface.
To avoid this, the only idea I have, is get cursor position from screen, then calculate scrollbar position on screen, and use timer or something to update my Control
. But it sounds very hard and ugly.
Any idea how to fix it?
EDIT: I meant Control
not UserControl
.
EDIT2: It receives mouse! I had bug in code, I called MouseDown in MouseMove method, but in MouseDown I had X/Y constraint that will force to return if X<0 etc.
Upvotes: 2
Views: 4019
Reputation: 8005
What you are looking for is called mouse capture
and is described here:
http://msdn.microsoft.com/en-us/library/ms171545(v=vs.80).aspx
In short:
Upvotes: 2