Even
Even

Reputation: 411

How to call maximize events manually

I am having one form, and I want that to load in the maximized state. How do I call the windows maximize event on form load?

Upvotes: 0

Views: 2018

Answers (3)

Christophe Geers
Christophe Geers

Reputation: 8962

Just set the form's WindowsState property to maximized. Then it should start up Maximized.

Upvotes: 3

Glenn Ferrie
Glenn Ferrie

Reputation: 10410

You should set the WindowState property of the form on the load of the form. Set it to FormWindowState.Maximized.

Upvotes: 6

Stephan
Stephan

Reputation: 4247

You should not call any events. Simply set the WindowState property to maximized:

Form form = new Form();
form.WindowState = FormWindowState.Maximized;
form.ShowDialog();

Upvotes: 4

Related Questions