Wednesday, March 19, 2008

Change MDI Container Background Color

MdiClient ctlMDI;

// Loop through all of the form's controls looking
// for the control of type MdiClient.
foreach (Control ctl in this.Controls)
{

try
{
// Attempt to cast the control to type MdiClient.
ctlMDI = (MdiClient)ctl;

// Set the BackColor of the MdiClient control.
ctlMDI.BackColor = this.BackColor;
}
catch (InvalidCastException)
{
// Catch and ignore the error if casting failed.
}

}

1 comment:

lccsoqui said...

in vb .net
just put a PictureBox inside the MDIparent form, then in its Dock property, put it in filland that's all