日期:2014-05-20 浏览次数:20833 次
private void button1_Click(object sender, RoutedEventArgs e) { SolidColorBrush myBrush = new SolidColorBrush(Colors.Green); this.rectangle1.Fill = myBrush; }
------解决方案--------------------
private void button1_Click(object sender, RoutedEventArgs e)
{
if (this.isClicked == false)
{
this.button1.IsEnabled = false;
}
else
{
this.isClicked = false;
this.rectangle1.Style = (Style)this.FindResource("rect1Style");
this.button1.IsEnabled = false;
}
}
自己写个rect1Style