Search code examples
c#winformsmaximize-window

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?


Solution

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

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