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. MDI

MDI

Scheduled Pinned Locked Moved C#
help
4 Posts 4 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.
  • J Offline
    J Offline
    Jag_K
    wrote on last edited by
    #1

    Hi, I have the following code, Form MDIChild = new Form1(); mdiChild.MdiParent = this; not sure what this does MDIChild.Show(); When i run the code with line 2 it gives me the error message "namespace mdichild can not be found" However if i comment out line 2,it works fine. I am not sure what line 2 does. Please can someone explain,and also explain how i should fix this. Thanks

    M G 2 Replies Last reply
    0
    • J Jag_K

      Hi, I have the following code, Form MDIChild = new Form1(); mdiChild.MdiParent = this; not sure what this does MDIChild.Show(); When i run the code with line 2 it gives me the error message "namespace mdichild can not be found" However if i comment out line 2,it works fine. I am not sure what line 2 does. Please can someone explain,and also explain how i should fix this. Thanks

      M Offline
      M Offline
      Maqsood Ahmed
      wrote on last edited by
      #2

      Anonymous wrote: mdiChild.MdiParent = this; try changing this to MDIChild.MdiParent = this; HTH, cheers :) Maqsood Ahmed [MCP,C#] Kolachi Advanced Technologies http://www.kolachi.net

      1 Reply Last reply
      0
      • J Jag_K

        Hi, I have the following code, Form MDIChild = new Form1(); mdiChild.MdiParent = this; not sure what this does MDIChild.Show(); When i run the code with line 2 it gives me the error message "namespace mdichild can not be found" However if i comment out line 2,it works fine. I am not sure what line 2 does. Please can someone explain,and also explain how i should fix this. Thanks

        G Offline
        G Offline
        gaby2r
        wrote on last edited by
        #3

        what it should do (if you change the mdiChild to it's correct name MDIChild) is assign the current form as mdiparrent to the MDIChild form. maybe the names confuse you. here is a better example: Form P = new Form(); Form C = new Form(); P.IsMdiContainer = true; //alows the form to contain MdiChilds C.MdiParent = P; //states that C is a MdiChild of P P.Show(); C.Show(); bare in mind that once a from is a mdiChild it cannot be a MdiParent as well(as in you can't have a mdi form inside an mdiform). In the above example if you set C.IsMdiContainer = true; an exception will be raised.

        A 1 Reply Last reply
        0
        • G gaby2r

          what it should do (if you change the mdiChild to it's correct name MDIChild) is assign the current form as mdiparrent to the MDIChild form. maybe the names confuse you. here is a better example: Form P = new Form(); Form C = new Form(); P.IsMdiContainer = true; //alows the form to contain MdiChilds C.MdiParent = P; //states that C is a MdiChild of P P.Show(); C.Show(); bare in mind that once a from is a mdiChild it cannot be a MdiParent as well(as in you can't have a mdi form inside an mdiform). In the above example if you set C.IsMdiContainer = true; an exception will be raised.

          A Offline
          A Offline
          Anonymous
          wrote on last edited by
          #4
          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