If the brush is a SolidBrush, you can compare the brush's Color element. Something like that.
SolidBrush solidBrush = brush as SolidBrush;
if (solidBrush != null && solidBrush.Color == SystemColors.ActiveCaption)
{
}
Above for WinForms, for WPF you would use SolidColorBrush , not SolidBrush.
source
share