WPF Window Drag/Move Boundary

Posted by Sentax on Stack Overflow See other posts from Stack Overflow or by Sentax
Published on 2009-02-20T01:56:44Z Indexed on 2010/03/21 16:31 UTC
Read the original article Hit count: 691

Filed under:
|

Hi everyone, just curious if you know of any way to setup a drag boundary for a window?

It would be nice to have these properties:

Me.MinLeft = 10
Me.MinTop = 10
Me.MaxLeft = 150
Me.MaxTop = 150

Those are made up properties, btw, which would be nice to have.

I know I could probably setup a timer to fire ever 10th of a second and check the left and top and then move it back if it's over. But it would be more elegant to have the window act like it hit a wall and can't go any farther, like moving to the edge of the screen or something similar.

Edit: There seems to be some confusion somewhere, the point I'm trying to make is in the paragraph above, dragging, not re-sizing.

© Stack Overflow or respective owner

Related posts about wpf

Related posts about winforms