需要帮助更改被动窗口的颜色。因此窗口将有两种不同的颜色,一种是在激活时,一种是在它被激活时(被动)。
这是我需要调用的两种方法:
void Activated(Object sender, EventArgs args)
{
this.Background = Brushes.Blue;
}
void Deactivated(Object sender, EventArgs args)
{
this.Background = Brushes.Green;
}
答案 0 :(得分:0)
private void Form1_Activated(object sender, EventArgs e)
{
BackColor = Color.Blue;
}
private void Form1_Deactivate(object sender, EventArgs e)
{
BackColor = Color.Green;
}