设置MDI父窗体的背景色

直接再设计界面设置BackColor属性没有用,可以通过代码来实现:
public Form1()
        {
            InitializeComponent();

            foreach (System.Windows.Forms.Control control in this.Controls)
            {
                if (control.GetType() == typeof(System.Windows.Forms.MdiClient))
                {
                    //control.BackColor = Color.Red;
                    control.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(224)),
    ((System.Byte)(224)), ((System.Byte)(224)));
                    break;
                }
            }
        }

posted on 2008-07-16 15:55  冷月孤峰  阅读(238)  评论(0)    收藏  举报