I wrote a Class which clamps Forms to the screen if they are moved near the edge.
After working out some problems, I'm left with just one:
Since I'm using the move event, the form is first moved to the mouse position and then to the edge of the screen, resulting in a flickering behavouir.
I have 2 ideas to solve the problem, but both need something I don't know how to achive.
1)
Prefered solution. (Behavior like Winamp)
The form is moved to the edge without prior move to the mouse.
I would need an event which is fired before the form is moved to the mouse,
and there I would need to be able to cancel the mouse movement (only partially, sometimes both directions).
But I wasn't able to find such an event.
2)
Clamp the form when the form is done moving.
The only problem here is that the mouse* events don't work on the frame of the form.
I have attached the Class.
After working out some problems, I'm left with just one:
Since I'm using the move event, the form is first moved to the mouse position and then to the edge of the screen, resulting in a flickering behavouir.
I have 2 ideas to solve the problem, but both need something I don't know how to achive.
1)
Prefered solution. (Behavior like Winamp)
The form is moved to the edge without prior move to the mouse.
I would need an event which is fired before the form is moved to the mouse,
and there I would need to be able to cancel the mouse movement (only partially, sometimes both directions).
But I wasn't able to find such an event.
2)
Clamp the form when the form is done moving.
The only problem here is that the mouse* events don't work on the frame of the form.
I have attached the Class.