The ResizeEnd
event is raised when the user finishes resizing a form, typically by dragging one of the borders or the sizing grip located on the lower-right corner of the form, and then releasing it. It also is raised when the user moves a form.
If for any reason you need maximizing the window cause raising the ResizeEnd
event you can raise the event this way:
const int WM_SYSCOMMAND = 0x0112;
const int SC_MAXIMIZE = 0xF030;
protected override void WndProc(ref Message m)
{
base.WndProc(ref m);
if (m.Msg == WM_SYSCOMMAND)
{
if (m.WParam == (IntPtr)SC_MAXIMIZE)
{
this.OnResizeEnd(EventArgs.Empty);
}
}
}
Note
- The
Resize
event is raised also when the form is maximized.
- The
Layout
event is a suitable event if you want to handle a custom layout.