{"id":744,"date":"2023-02-19T10:48:06","date_gmt":"2023-02-19T09:48:06","guid":{"rendered":"https:\/\/thomasjansen.eu\/?p=744"},"modified":"2023-02-19T10:48:06","modified_gmt":"2023-02-19T09:48:06","slug":"adding-a-mdi-child-directly-when-opening-the-application-net-6-0","status":"publish","type":"post","link":"https:\/\/thomas-jansen.eu\/?p=744","title":{"rendered":"Adding a MDI child directly when opening the application (.NET 6.0)"},"content":{"rendered":"\n<p>In .NET 6.0 adding a MDI child only seems to work after the MDI parent is loaded. Therefore add the MDI child creation code in the Shown event handler and all functions correctly.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>    private void MDIParent_Shown(object sender, EventArgs e)\n    {\n       MDIChild child = new MDIChild();\n       child.MdiParent = this;\n       child.Show();\n    }<\/code><\/pre>\n\n\n\n<p>MDIForm is a standard form, note that the MDIParent form  needs the IsMdiContainer property set to true;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In .NET 6.0 adding a MDI child only seems to work after the MDI parent is loaded. Therefore add the MDI child creation code in the Shown event handler and all functions correctly. MDIForm is a standard form, note that the MDIParent form needs the IsMdiContainer property set to true;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-744","post","type-post","status-publish","format-standard","hentry","category-c"],"_links":{"self":[{"href":"https:\/\/thomas-jansen.eu\/index.php?rest_route=\/wp\/v2\/posts\/744","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thomas-jansen.eu\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thomas-jansen.eu\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thomas-jansen.eu\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/thomas-jansen.eu\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=744"}],"version-history":[{"count":2,"href":"https:\/\/thomas-jansen.eu\/index.php?rest_route=\/wp\/v2\/posts\/744\/revisions"}],"predecessor-version":[{"id":746,"href":"https:\/\/thomas-jansen.eu\/index.php?rest_route=\/wp\/v2\/posts\/744\/revisions\/746"}],"wp:attachment":[{"href":"https:\/\/thomas-jansen.eu\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=744"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thomas-jansen.eu\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=744"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thomas-jansen.eu\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=744"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}