private void Button_Click(object sender, RoutedEventArgs e) { foreach (var button in myStack.Children) { if (button is Button) { (button as Button).Background = Brushes.Green; } } (sender as Button).Background = Brushes.Red; }
private void ButtonMe_Click(object sender, RoutedEventArgs e) { for (int i = 0; i < row; i++) { for (int j = 0; j < col; j++) { if(sender is Button) { } } } ((Button)sender).Background = Brushes.Red; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)