Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Problems with opening Child Window in MDI

Problems with opening Child Window in MDI

Scheduled Pinned Locked Moved C#
helpquestion
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    RichardAlbrecht
    wrote on last edited by
    #1

    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

    K 1 Reply Last reply
    0
    • R RichardAlbrecht

      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

      K Offline
      K Offline
      KaineDunno
      wrote on last edited by
      #2

      try resizing your forms in design time. think that could help... i dont see anything wrong in the posted code. Greetings

      R 1 Reply Last reply
      0
      • K KaineDunno

        try resizing your forms in design time. think that could help... i dont see anything wrong in the posted code. Greetings

        R Offline
        R Offline
        RichardAlbrecht
        wrote on last edited by
        #3

        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

        P 1 Reply Last reply
        0
        • R RichardAlbrecht

          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

          P Offline
          P Offline
          Pete OHanlon
          wrote on last edited by
          #4

          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.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups