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 Behaviour

MDI Behaviour

Scheduled Pinned Locked Moved C#
csharpmcphelp
5 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.
  • M Offline
    M Offline
    Maqsood Ahmed
    wrote on last edited by
    #1

    Hello, Usually when I drop some controls at the MDI Parent and later open Mdi Child forms, I can see MDI Parent controls on the top of child forms. Is there any way that we can display Child forms without displaying MDI Parent controls. I know that SetWindowPos can make a child form topmost. but It'll be on the top of all other forms too which is not a good solution to the problem. Any suggestions in this regard will be appreciated. TIA Maqsood Ahmed [MCP,C#] Kolachi Advanced Technologies http://www.kolachi.net

    A 1 Reply Last reply
    0
    • M Maqsood Ahmed

      Hello, Usually when I drop some controls at the MDI Parent and later open Mdi Child forms, I can see MDI Parent controls on the top of child forms. Is there any way that we can display Child forms without displaying MDI Parent controls. I know that SetWindowPos can make a child form topmost. but It'll be on the top of all other forms too which is not a good solution to the problem. Any suggestions in this regard will be appreciated. TIA Maqsood Ahmed [MCP,C#] Kolachi Advanced Technologies http://www.kolachi.net

      A Offline
      A Offline
      Ashok Dhamija
      wrote on last edited by
      #2

      Try setting Visible property to False on the controls on the MDI parent form at the time of displaying a particular child form (when you do not want to display them alongwith the child form).

      M 1 Reply Last reply
      0
      • A Ashok Dhamija

        Try setting Visible property to False on the controls on the MDI parent form at the time of displaying a particular child form (when you do not want to display them alongwith the child form).

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

        Hello, Not feasible. Suppose a Groupbox is placed at the MDI Parent with some child controls. MDI child form covers a part of the groupbox and its contained controls. How can this solution help in this regard :) thanks for the response anyways. Maqsood Ahmed [MCP,C#] Kolachi Advanced Technologies http://www.kolachi.net

        A 1 Reply Last reply
        0
        • M Maqsood Ahmed

          Hello, Not feasible. Suppose a Groupbox is placed at the MDI Parent with some child controls. MDI child form covers a part of the groupbox and its contained controls. How can this solution help in this regard :) thanks for the response anyways. Maqsood Ahmed [MCP,C#] Kolachi Advanced Technologies http://www.kolachi.net

          A Offline
          A Offline
          Ashok Dhamija
          wrote on last edited by
          #4

          The probelm mentioned by you arises because you are perhaps trying to put some controls on the client area of parent form, instead of putting the same on the non-client area. The child form which would occupy the client area will naturally cover the client area, which inter alia means that the controls on the parent form (which are in the client area) are also covered at least partially. One thing is sure that if you put some controls on the non-client are of parent form, then the child form will not cover them. But, the big question is why do you need to put some controls in client area of the parent form, when in the same area you have to show the child form? Why can't you put these controls on the non-client area of the parent form? If there is some compelling reason for you to put the said controls in client area of the parent form itself, then these are the available options: 1. Make the application Single Form instead of MDI. Here, you'll have the option of showing other forms as independent forms called from the main form (though now they will not be the child forms, i.e., they will not be covered only in the client area of the main form; and plus some other pros and cons). So your child form functionality can be achieved through such other independent forms. 2. Second option is to have MDI format itself and put the controls in the client are of the parent form itself, if you don't have any other options. But, now try to limit the size of the child form in such a manner that the child form opens in the other part of the client are of parent form which does not have the parent controls. And, keep the size and location of the child form under your strict control in the code (e.g., non-flexible such as non-maximizable or fixed-single borderstyle property or subject to some co-ordinate limits by checking in code etc.) This will ensure that the parent controls are not hidden by the child form. 3. The third option is to make the Visible property of parent controls false if it is feasible, as I suggested earlier. 4. The best solution would of course be NOT to put the controls in the client area of the parent form. Regards

          R 1 Reply Last reply
          0
          • A Ashok Dhamija

            The probelm mentioned by you arises because you are perhaps trying to put some controls on the client area of parent form, instead of putting the same on the non-client area. The child form which would occupy the client area will naturally cover the client area, which inter alia means that the controls on the parent form (which are in the client area) are also covered at least partially. One thing is sure that if you put some controls on the non-client are of parent form, then the child form will not cover them. But, the big question is why do you need to put some controls in client area of the parent form, when in the same area you have to show the child form? Why can't you put these controls on the non-client area of the parent form? If there is some compelling reason for you to put the said controls in client area of the parent form itself, then these are the available options: 1. Make the application Single Form instead of MDI. Here, you'll have the option of showing other forms as independent forms called from the main form (though now they will not be the child forms, i.e., they will not be covered only in the client area of the main form; and plus some other pros and cons). So your child form functionality can be achieved through such other independent forms. 2. Second option is to have MDI format itself and put the controls in the client are of the parent form itself, if you don't have any other options. But, now try to limit the size of the child form in such a manner that the child form opens in the other part of the client are of parent form which does not have the parent controls. And, keep the size and location of the child form under your strict control in the code (e.g., non-flexible such as non-maximizable or fixed-single borderstyle property or subject to some co-ordinate limits by checking in code etc.) This will ensure that the parent controls are not hidden by the child form. 3. The third option is to make the Visible property of parent controls false if it is feasible, as I suggested earlier. 4. The best solution would of course be NOT to put the controls in the client area of the parent form. Regards

            R Offline
            R Offline
            Rizwan Bashir
            wrote on last edited by
            #5

            try this make a new form and place the controls on it. and in MDI change the inherit statment of MDI Class to this newly added form containing controls and see if this you need to do cheers........

            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