Microsoft Communities

Welcome to WindowsClient.net | Sign in | Join

Here are some frequently asked questions about Windows Forms and their answers.

Windows Forms FAQs

How do I change the background of an MDI Client container?

The default behavior is to make the client container use the Control color from the Control panel. You can change this behavior by making the MDI Client container use the form's BackColor and Image. To do this, after the call to InitializeComponents(), add the code below. You can also download a working MDI Client project that has this code in it.

//set back color 
foreach ( Control c in Controls ) 
{ 
  if ( c is MdiClient ) 
  { 
    c.BackColor = BackColor; 
    c.BackgroundImage = BackgroundImage; 
  } 
}

Contributed from George Shepherd's Windows Forms FAQ



Page view counter