C#,我想遍历当前的窗体,然后把窗体的背景颜色变成我想要的颜色,这个不行啊,不进foreach
foreach(ControlcontrolinControls){if(controlisForm){control.BackgroundImage=Image.Fro...
foreach (Control control in Controls)
{
if (control is Form)
{
control.BackgroundImage = Image.FromFile(System.Environment.CurrentDirectory + @"\images\background_images_main.png", false);
}
// InitializeComponent();
} 展开
{
if (control is Form)
{
control.BackgroundImage = Image.FromFile(System.Environment.CurrentDirectory + @"\images\background_images_main.png", false);
}
// InitializeComponent();
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询