Monday, April 4, 2011

How to change the background color of an MDI parent form in Visual C#:


Just copy and paste in load event of MDI Parent Form:

       
            MdiClient mdi;
            foreach (Control c in this.Controls)
            {
                try
                {
                    mdi = (MdiClient) c;
                    mdi.BackColor = Color.White;
                }
                catch
                {
                    //Unable to cast object of type 'System.Windows.Forms.Button' to type 'System.Windows.Forms.MdiClient'.
                }

            }
 

No comments:

Post a Comment