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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top