Skip the Form.SizeChanged event at start

Viewed 101

I have this event handler:

private void Form1_SizeChanged(object sender, EventArgs e)
{

}

But I don't want that it will be called at the start (only when the user changes the size). Is this possible?

1 Answers

Add a boolean field called _formLoaded and set it to false. When the form is loaded, set it to true.

Then, in the SizeChanged event handler, start with:

if (_formLoaded)
Related