Resize winform window only when resizing

Is there a way to resize the Winform window only in Resize ?

This means that as long as the mouse is clicked I see the lines, and only when I leave the mouse window (resize) will the screen be resized.

+4
source share
2 answers

You will need to use DrawReversibleFrame . Resizing by default must be disabled (FormBorderStyle = FixedSingle).

The basic logic is

MouseDown - Start Tracking
MouseMove - Draw a reversible frame
MouseUp - Stop reverse reverse frame. Resize.

Fortunately, this MSDN post had working code for this. I have a working sample for you. http://www.mediafire.com/download/427g2h2ajm5z62m/ResizeFrame.zip

You will need to configure this to resize the form only when the user “MouseDown” is near the border.

+2
source

If it is so that only the controls contained in it change size (and the form itself - immediately), use the event

Note : "The ResizeEnd event is also raised after the user moves the form."

+2
source

Source: https://habr.com/ru/post/1502233/


All Articles