if (backBrush == SystemColors.ActiveCaption)
This fails. Says you can't compare a brush and a color.
How do I find the color of the brush?
If backBrush is a SolidColorBrush (based on what you're trying to do it probably is) you can use:
if(((SolidColorBrush)backBrush).Color == SystemColors.ActiveCaption)
If the brush is a SolidBrush you can compare the Color member of the brush. Something like this.
SolidBrush solidBrush = brush as SolidBrush;
if (solidBrush != null && solidBrush.Color == SystemColors.ActiveCaption)
{
// ....
}
The above is for WinForms, for WPF you would use SolidColorBrush rather than SolidBrush.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With