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. problem with windows application

problem with windows application

Scheduled Pinned Locked Moved C#
helptutorial
6 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.
  • U Offline
    U Offline
    User 3055467
    wrote on last edited by
    #1

    Hi, I am working on a windows application involving MDI forms and child forms. The problem here is when I click an item in the menu bar I am displaying a child form. the child form should be in such a way that it is displayed inside the MDI form and should not be like popup box.I have done this as shown below. Childfrm.TopLevel=False; this.Panel1.Controls.Add(Childfrm); Childfrm.show(); it's working well but the controlbox with title bar is being displayed seperately in maximised mode.I want the control box beside MDI form menu and child form title beside mdi form title. A very good example of this functionality is Edit plus. I request any one who worked on this type of requirement to help me in solving this problem Thanks in advance

    0 1 Reply Last reply
    0
    • U User 3055467

      Hi, I am working on a windows application involving MDI forms and child forms. The problem here is when I click an item in the menu bar I am displaying a child form. the child form should be in such a way that it is displayed inside the MDI form and should not be like popup box.I have done this as shown below. Childfrm.TopLevel=False; this.Panel1.Controls.Add(Childfrm); Childfrm.show(); it's working well but the controlbox with title bar is being displayed seperately in maximised mode.I want the control box beside MDI form menu and child form title beside mdi form title. A very good example of this functionality is Edit plus. I request any one who worked on this type of requirement to help me in solving this problem Thanks in advance

      0 Offline
      0 Offline
      0x3c0
      wrote on last edited by
      #2

      Try setting the IsMdiChild property of Childfrm to true, setting this.IsMdiContainer to true, and setting Childfrm.MdiParent to this

      Between the idea And the reality Between the motion And the act Falls the Shadow

      U 1 Reply Last reply
      0
      • 0 0x3c0

        Try setting the IsMdiChild property of Childfrm to true, setting this.IsMdiContainer to true, and setting Childfrm.MdiParent to this

        Between the idea And the reality Between the motion And the act Falls the Shadow

        U Offline
        U Offline
        User 3055467
        wrote on last edited by
        #3

        Hi thanks for ur reply. but it's not not working. The code is given below. //childform.IsMdiChild = true; childform.MdiParent = this; childform.TopLevel = false; splitContainer1.Panel2.Controls.Add(childform); childform.Show(); the first line is giving an error saying "Property or indexer 'System.Windows.Forms.Form.IsMdiChild' cannot be assigned to -- it is read only".

        D 1 Reply Last reply
        0
        • U User 3055467

          Hi thanks for ur reply. but it's not not working. The code is given below. //childform.IsMdiChild = true; childform.MdiParent = this; childform.TopLevel = false; splitContainer1.Panel2.Controls.Add(childform); childform.Show(); the first line is giving an error saying "Property or indexer 'System.Windows.Forms.Form.IsMdiChild' cannot be assigned to -- it is read only".

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          If TopLevel is false, the form can no longer be an MdiChild.

          A guide to posting questions on CodeProject[^]
          Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
               2006, 2007, 2008
          But no longer in 2009...

          U 1 Reply Last reply
          0
          • D Dave Kreskowiak

            If TopLevel is false, the form can no longer be an MdiChild.

            A guide to posting questions on CodeProject[^]
            Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                 2006, 2007, 2008
            But no longer in 2009...

            U Offline
            U Offline
            User 3055467
            wrote on last edited by
            #5

            but i need it since I should show the child window within the mdi form.It should not look like a popup window. thanks and regards

            D 1 Reply Last reply
            0
            • U User 3055467

              but i need it since I should show the child window within the mdi form.It should not look like a popup window. thanks and regards

              D Offline
              D Offline
              Dave Kreskowiak
              wrote on last edited by
              #6

              Well, you're going to have to change your design. An MdiParent form cannot be an MdiChild to another MdiParent. About the best you're going to get would be to write code that handles the Move and Resize events of the child form you want and contrain it to the boundries of the MdiParent's MdiClient area, or an MdiChild form's boundries. No, I don't have sample code because I've never needed to to anything like that.

              A guide to posting questions on CodeProject[^]
              Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                   2006, 2007, 2008
              But no longer in 2009...

              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