foreach (Control control in this.Controls) { MdiClient client = control as MdiClient; if (!(client == null)) { client.BackColor = GetYourColour(); } }
رو فرم اصلی دکمه F7 رو بزنید و تو قسمت سازنده کد رو بنویسین به صورت زیر :
public Form1() { InitializeComponent(); foreach (Control control in this.Controls) { MdiClient client = control as MdiClient; if (!(client == null)) { client.BackColor = Color.Red; } } }
کد زیر :
foreach (Control ctl in this.Controls) { if (ctl is MdiClient) { ctl.BackgroundImage = Image.FromFile("d:\\Desert.jpg"); } }
2,337 سوال
2,871 پاسخ
3,725 دیدگاه
3,924 کاربر