Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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.

CtS.zip

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...