因此,我要求高对比度并将背景色设置为红色:
private void HoherKontrast()
{
if (SystemParameters.HighContrast == true)
{
AKTIVES_ELEMENT_CONTRAST = Brushes.Red;
NICHTAKTIVES_ELEMENT_CONTRAST = Brushes.Black;
}
}
如果文本编辑器处于无障碍模式,则背景颜色为红色:
private void ComboboxGotKeyboardFocus(object sender, KeyboardFocusChangedEventArgs e)
{
if (ChkBarrierefrei.IsChecked.Value == true)
{
ComboBox source = e.Source as ComboBox;
if (source != null)
{
source.Background = AKTIVES_ELEMENT_CONTRAST;
}
}
}
问题: 背景颜色不会变为红色,并且组合框具有蓝色条。
我要怎么做才能使组合框的背景颜色变为红色?