mdiparent

C# MDI Parent detect when MDI Child is closing?

你离开我真会死。 提交于 2019-12-01 17:39:22
问题 I'm attempting to detect, on the MDI parent, when my MDI child form closes, and react accordingly. The MDI parent shouldn't do anything until the MDI child closes. Here is my code, I'm unsure as to what I'm doing wrong, but the form closed event method I added is never being called... The following code is in the MDI parent class, if that wasn't obvious. private void keyValidation() { if (Properties.Settings.Default.Unlock == true) return; else { menu.Enabled = false; statusStrip.Enabled =

Size/Location of Winforms MDI Client Area

馋奶兔 提交于 2019-11-28 11:04:05
Inside an MDI form is a client area that hosts the mdi child forms. How do I find out how big that area is? The best I can come up with so far is finding the total size of the parent's potential client area (mdiparent.ClientRectangle) and then subtracting off the sizes of components like toolbars, etc that take away from the client area. Is there a better way? There is no property on a form that gives you access to the MDI client window. But you can find it back like this: public MdiClient GetMdiClientWindow() { foreach (Control ctl in this.Controls) { if (ctl is MdiClient) return ctl as

Size/Location of Winforms MDI Client Area

╄→гoц情女王★ 提交于 2019-11-27 05:55:21
问题 Inside an MDI form is a client area that hosts the mdi child forms. How do I find out how big that area is? The best I can come up with so far is finding the total size of the parent's potential client area (mdiparent.ClientRectangle) and then subtracting off the sizes of components like toolbars, etc that take away from the client area. Is there a better way? 回答1: There is no property on a form that gives you access to the MDI client window. But you can find it back like this: public

How do I display a popup from a WebBrowser in another window I created?

戏子无情 提交于 2019-11-26 03:36:21
问题 I am trying to implement a simple web browser control in one of my apps. This is to help integrate a web app into a toolset i am creating. The problem is, this web app absolutly loves popup windows.... When a popup is opened, it opens in an IE window which is not a child of the MDI Container form that my main window is part of. How can i get any and all popups created by clicking links in my WebBrowser to be a child of my MDI container (similar to setting the MDIParent property of a form)?