Problems with opening Child Window in MDI
-
I have a main form with menu options to open child forms within this main form window. Problem I am seeing is that I get scroll bars when I do this. if I move around with the scroll bars they disappear and give me what I wanted. Now if I make the menu invisible the child form opens correctly. But I need the menu bar so other child forms can be opened. The goals is the following for every child form opened; • Without scroll bars • Without control box • With the main menu bar still visible • Child window docked nicely. Does anyone have ideas as to why I am getting this behavior and how I can get the behavior I want? Sample of the current code to open the child form from the main form. private void menuBornEntry_Click(object sender, System.EventArgs e) { /// Performing Born Entry activity . . . frmBornEntry dlgBornEntry = new frmBornEntry () ; dlgBornEntry.MdiParent = this ; dlgBornEntry.Activated += new EventHandler(ChildWindow_Opened); dlgBornEntry.Closed += new EventHandler(ChildWindow_Closed); dlgBornEntry.Dock = DockStyle.Fill ; dlgBornEntry.Show () ; } Thanks Rich
-
I have a main form with menu options to open child forms within this main form window. Problem I am seeing is that I get scroll bars when I do this. if I move around with the scroll bars they disappear and give me what I wanted. Now if I make the menu invisible the child form opens correctly. But I need the menu bar so other child forms can be opened. The goals is the following for every child form opened; • Without scroll bars • Without control box • With the main menu bar still visible • Child window docked nicely. Does anyone have ideas as to why I am getting this behavior and how I can get the behavior I want? Sample of the current code to open the child form from the main form. private void menuBornEntry_Click(object sender, System.EventArgs e) { /// Performing Born Entry activity . . . frmBornEntry dlgBornEntry = new frmBornEntry () ; dlgBornEntry.MdiParent = this ; dlgBornEntry.Activated += new EventHandler(ChildWindow_Opened); dlgBornEntry.Closed += new EventHandler(ChildWindow_Closed); dlgBornEntry.Dock = DockStyle.Fill ; dlgBornEntry.Show () ; } Thanks Rich
try resizing your forms in design time. think that could help... i dont see anything wrong in the posted code. Greetings
-
try resizing your forms in design time. think that could help... i dont see anything wrong in the posted code. Greetings
I tried resizing the child form but it ended up being too small in the main form window which is not the desired goal. no matter how I resized it I would have the child form either too small and get the scroll bars. Thanks
-
I tried resizing the child form but it ended up being too small in the main form window which is not the desired goal. no matter how I resized it I would have the child form either too small and get the scroll bars. Thanks
Set the WindowState of the child form to Maximized. This means that the child window will show maximized in the MDI frame - which will put the close/minimize/maximize buttons in the MDI frame window.
Deja View - the feeling that you've seen this post before.