Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

window state maximize not working

Tags:

c#

winforms

mdi

I am opening a form in a mdi parent. I show the form in the parent and the window state of the new form in the designer is maximized. For some reason, the form appears in the top left corner of the mdi parent, and the control box is way over to the right as if it was maximized, but the size of the window is not filling up the screen. So the behavior is as if it were maximized, but it is not filling the screen. What should I do?

I'm using C#.Net Winform.

like image 910
marai Avatar asked Jan 01 '26 05:01

marai


2 Answers

Set your child form's window state to maximized. This will maximize your form.

childForm.WindowState = FormWindowState.Maximized;

You can do this on load of your MdiParent form, or whenever you open show this child form.

like image 153
nunespascal Avatar answered Jan 02 '26 17:01

nunespascal


Make sure your MdiChilds MaximumSize Property is not set. If it is it will look like this, which looks like what you have described in your question.

enter image description here

like image 25
Mark Hall Avatar answered Jan 02 '26 19:01

Mark Hall