End of form resize

  • Thread starter Thread starter MCzajk
  • Start date Start date
M

MCzajk

How to determine if user has ended resizing form? I need to invoke
time-consuming operation after the form's size has changed. SizeChanded
event seems to be triggered more than once during resizing.

MCzajk
 
One way you can do this is to override the Form's WndProc method and look
for WM_EXITSIZEMOVE

private bool inSizing = false;
protected override void WndProc(ref System.Windows.Forms.Message m)
{
if(m.Msg == 0x214) // (WM_SIZING
inSizing = true;
if(m.Msg == 0x232 && inSizing) // WM_EXITSIZEMOVE
{
Console.WriteLine("sizing ended");
inSizing = false;
}
base.WndProc(ref m);
}

================
Clay Burch, .NET MVP

Visit www.syncfusion.com for the coolest tools
 
Back
Top