C#, when I maximize the form it moves to the top left

581 Views Asked by At

When I maximize the form, the form is positioned in the upper left and does not grow. I designed the minimize, maximize and exit buttons that I use. I set FormBorderStyle=None and FormStartPosition=CenterScreen.

To maximize the window, I used the code this.WindowState = FormWindowState.Maximized;.

I should also say that I am calling the place where the user is logged in from another form.

These are the results I got:

Normal enter image description here

Maximized enter image description here

1

There are 1 best solutions below

1
Anas Abdullah Al On

Check if the Form MaximumSize property is set to 0,0. If not set it to 0,0 then rebuild the project and test if it's working.

enter image description here