0
votes

Description

  1. I have Main form (Home) with IsMDIContainer property set to true.
  2. Then i added a panel on form and set it DOCK property to FILL
  3. After that i created child form (products) and open on main form on button click.

Problem i am facing

when i clicked on button to open product i can't see any form. Either it is overlayed by panel or some thing else is going on which i don't know.

What i tried

  1. Changed HOME form IsMDIContainer property back to false

  2. change panel DOCK to bottom (for test)

  3. Again set IsMDIConatiner to true , i got the form.

What i want ?

i want that panel to be DOCK fill and want MDI Parent and child functional should function

enter image description here

1
This is normal behaviour. When you put a panel on your mainform, and dock it, than only the remaining (all part of your mainform that is not filled by the panel) is availiable space for your mdichild forms. So by setting docked=fill you leave no space left for your mdi child forms. What are you trying to achive, maybe there is another way to do itGuidoG
Are you looking for changing the back color of MDI client area?Reza Aghaei
The gray area you see is not the client area of the Form. It's actually a control, called MdiClient. If you want to change it's color, you could just use the MDiParent.Controls collection, find MdiClient and change it's BackColor.Jimi
Actually i want to achieve mdi parent and child functionality. Child form on minimize go to bottom of parent form instead of task bar. Also want that panel with dock property.Zohaib Waqar
Why would you want a Panel inside a MDIContainer? To what end?Jimi

1 Answers

0
votes

Setting TopMost property of child form to true And ShowOnTaskBar to false i got it fixed

  1. Set show on task bar property of form to false
  2. Call a method on form resize checked the FormWindowState
  3. if it is minimized then i set the TopMost property of child form to true

        private void Form1_Resize(object sender, EventArgs e)
        {
            Form minimizedForm = sender as Form;
            if (minimizedForm.WindowState == FormWindowState.Minimized)
            {
    
                minimizedForm.TopMost = true;
            }
        }