I have to set the grid background based on the result. that is working fine.
But when I am clicking again the button, it is not set to white color.
- private void Conversion_Click(object sender, RoutedEventArgs e)
- {
- grid.Background = new SolidColorBrush(Colors.White);
- bool result = DoConversion();
- if (result)
- {
- grid.Background = new SolidColorBrush(Colors.Green);
- }
- else
- {
- grid.Background = new SolidColorBrush(Colors.Red);
- }
- }
Piyush PansuriyaRank #454 · 5.5K reputationPosted Nov 13, 2019, 10:10 PM EST
Ranjith Kumar29 reputationPosted Nov 13, 2019, 10:19 PM EST
Mageshwaran RRank #411 · 6.1K reputationPosted Nov 13, 2019, 10:45 PM EST
Ranjith Kumar29 reputationPosted Nov 14, 2019, 8:06 PM EST
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questionsTop experts