设置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;
}
}
}
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;
}
}
}
浙公网安备 33010602011771号