MDI Parent window height shrinks on restore (after minimize/maximize) if an MDI child is maximized
Whenever I minimize or maximize an MDI Parent form while it has a child form maximized, the height of the MDI Parent shrinks by roughly 20px.
I started out with .Net Framework 4.0 and had this problem, so I tried other versions and continued to have problem.
Here are some steps to replicate (trying 4.7.1 this time):
- Closed all instances of VS2017 and open VS2017.
- File > New > Project.
- Name: MdiTest2; Framework 4.7.2; Hit OK.
- Set Form1 "IsMdiContainer" to True.
- Right-click project > Add > Windows Form... Called this ChildForm.vb.
- Went back to Form1, doubl-clicked form.
- Set Form1 load event to following:
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim frm As New ChildForm
frm.MdiParent = Me
frm.WindowState = FormWindowState.Maximized
frm.Show()
End Sub
- Started debugging
- Drag Parent form somewhere so that you'll notice changes to height of form (align the bottom of form with another form, icon, or top of taskbar).
- Maximize the form and then click restore button... Notice form resizes
- Minimize the form and then click the icon for it on the taskbar...
- Notice the form resizes (for me), the top of the form stays at original location, but the bottom border moves up ~20px.
- If I continue to click the apps icon on taskbar, it will continue to shrink ever time the form is restored.
Is anyone able to replicate this or is this just a bug on my machine? My resolution is 2560x1440 and scaling is set to 100%. If I change AutoScaleMode on Form1 and ChildForm from "Font" (default) to "None", I still have this problem. If I do not have an MDI Child form maximized when I Minimize/Maximize the MDI Parent, the MDI Parent height does not shrink when restored.
vb.net visual-studio-2017 mdi mdiparent
add a comment |
Whenever I minimize or maximize an MDI Parent form while it has a child form maximized, the height of the MDI Parent shrinks by roughly 20px.
I started out with .Net Framework 4.0 and had this problem, so I tried other versions and continued to have problem.
Here are some steps to replicate (trying 4.7.1 this time):
- Closed all instances of VS2017 and open VS2017.
- File > New > Project.
- Name: MdiTest2; Framework 4.7.2; Hit OK.
- Set Form1 "IsMdiContainer" to True.
- Right-click project > Add > Windows Form... Called this ChildForm.vb.
- Went back to Form1, doubl-clicked form.
- Set Form1 load event to following:
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim frm As New ChildForm
frm.MdiParent = Me
frm.WindowState = FormWindowState.Maximized
frm.Show()
End Sub
- Started debugging
- Drag Parent form somewhere so that you'll notice changes to height of form (align the bottom of form with another form, icon, or top of taskbar).
- Maximize the form and then click restore button... Notice form resizes
- Minimize the form and then click the icon for it on the taskbar...
- Notice the form resizes (for me), the top of the form stays at original location, but the bottom border moves up ~20px.
- If I continue to click the apps icon on taskbar, it will continue to shrink ever time the form is restored.
Is anyone able to replicate this or is this just a bug on my machine? My resolution is 2560x1440 and scaling is set to 100%. If I change AutoScaleMode on Form1 and ChildForm from "Font" (default) to "None", I still have this problem. If I do not have an MDI Child form maximized when I Minimize/Maximize the MDI Parent, the MDI Parent height does not shrink when restored.
vb.net visual-studio-2017 mdi mdiparent
add a comment |
Whenever I minimize or maximize an MDI Parent form while it has a child form maximized, the height of the MDI Parent shrinks by roughly 20px.
I started out with .Net Framework 4.0 and had this problem, so I tried other versions and continued to have problem.
Here are some steps to replicate (trying 4.7.1 this time):
- Closed all instances of VS2017 and open VS2017.
- File > New > Project.
- Name: MdiTest2; Framework 4.7.2; Hit OK.
- Set Form1 "IsMdiContainer" to True.
- Right-click project > Add > Windows Form... Called this ChildForm.vb.
- Went back to Form1, doubl-clicked form.
- Set Form1 load event to following:
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim frm As New ChildForm
frm.MdiParent = Me
frm.WindowState = FormWindowState.Maximized
frm.Show()
End Sub
- Started debugging
- Drag Parent form somewhere so that you'll notice changes to height of form (align the bottom of form with another form, icon, or top of taskbar).
- Maximize the form and then click restore button... Notice form resizes
- Minimize the form and then click the icon for it on the taskbar...
- Notice the form resizes (for me), the top of the form stays at original location, but the bottom border moves up ~20px.
- If I continue to click the apps icon on taskbar, it will continue to shrink ever time the form is restored.
Is anyone able to replicate this or is this just a bug on my machine? My resolution is 2560x1440 and scaling is set to 100%. If I change AutoScaleMode on Form1 and ChildForm from "Font" (default) to "None", I still have this problem. If I do not have an MDI Child form maximized when I Minimize/Maximize the MDI Parent, the MDI Parent height does not shrink when restored.
vb.net visual-studio-2017 mdi mdiparent
Whenever I minimize or maximize an MDI Parent form while it has a child form maximized, the height of the MDI Parent shrinks by roughly 20px.
I started out with .Net Framework 4.0 and had this problem, so I tried other versions and continued to have problem.
Here are some steps to replicate (trying 4.7.1 this time):
- Closed all instances of VS2017 and open VS2017.
- File > New > Project.
- Name: MdiTest2; Framework 4.7.2; Hit OK.
- Set Form1 "IsMdiContainer" to True.
- Right-click project > Add > Windows Form... Called this ChildForm.vb.
- Went back to Form1, doubl-clicked form.
- Set Form1 load event to following:
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim frm As New ChildForm
frm.MdiParent = Me
frm.WindowState = FormWindowState.Maximized
frm.Show()
End Sub
- Started debugging
- Drag Parent form somewhere so that you'll notice changes to height of form (align the bottom of form with another form, icon, or top of taskbar).
- Maximize the form and then click restore button... Notice form resizes
- Minimize the form and then click the icon for it on the taskbar...
- Notice the form resizes (for me), the top of the form stays at original location, but the bottom border moves up ~20px.
- If I continue to click the apps icon on taskbar, it will continue to shrink ever time the form is restored.
Is anyone able to replicate this or is this just a bug on my machine? My resolution is 2560x1440 and scaling is set to 100%. If I change AutoScaleMode on Form1 and ChildForm from "Font" (default) to "None", I still have this problem. If I do not have an MDI Child form maximized when I Minimize/Maximize the MDI Parent, the MDI Parent height does not shrink when restored.
vb.net visual-studio-2017 mdi mdiparent
vb.net visual-studio-2017 mdi mdiparent
asked Nov 19 '18 at 21:11
Daniel PDaniel P
112
112
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
After doing a lot of searching and not finding anyone else with this bug, I started asking myself: "why would others not have this problem". Well, my program will not have a MenuStrip, but almost all MDI parent forms have one. So, on a hunch, I added a menu strip to the form and it fixed my problem. I then set the visibility of the MenuStrip to false and tested... it still works with MenuStrip visibility set to false.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53382697%2fmdi-parent-window-height-shrinks-on-restore-after-minimize-maximize-if-an-mdi%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
After doing a lot of searching and not finding anyone else with this bug, I started asking myself: "why would others not have this problem". Well, my program will not have a MenuStrip, but almost all MDI parent forms have one. So, on a hunch, I added a menu strip to the form and it fixed my problem. I then set the visibility of the MenuStrip to false and tested... it still works with MenuStrip visibility set to false.
add a comment |
After doing a lot of searching and not finding anyone else with this bug, I started asking myself: "why would others not have this problem". Well, my program will not have a MenuStrip, but almost all MDI parent forms have one. So, on a hunch, I added a menu strip to the form and it fixed my problem. I then set the visibility of the MenuStrip to false and tested... it still works with MenuStrip visibility set to false.
add a comment |
After doing a lot of searching and not finding anyone else with this bug, I started asking myself: "why would others not have this problem". Well, my program will not have a MenuStrip, but almost all MDI parent forms have one. So, on a hunch, I added a menu strip to the form and it fixed my problem. I then set the visibility of the MenuStrip to false and tested... it still works with MenuStrip visibility set to false.
After doing a lot of searching and not finding anyone else with this bug, I started asking myself: "why would others not have this problem". Well, my program will not have a MenuStrip, but almost all MDI parent forms have one. So, on a hunch, I added a menu strip to the form and it fixed my problem. I then set the visibility of the MenuStrip to false and tested... it still works with MenuStrip visibility set to false.
answered Nov 19 '18 at 22:04
Daniel PDaniel P
112
112
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53382697%2fmdi-parent-window-height-shrinks-on-restore-after-minimize-maximize-if-an-mdi%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown