Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/.net/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
.net WPF ComboBox不支持Windows 10上的背景设置程序_.net_Wpf_Windows_Xaml_Combobox - Fatal编程技术网

.net WPF ComboBox不支持Windows 10上的背景设置程序

.net WPF ComboBox不支持Windows 10上的背景设置程序,.net,wpf,windows,xaml,combobox,.net,Wpf,Windows,Xaml,Combobox,我有一个简单的组合框,源代码附在下面: <Window x:Class="ComboBoxTest.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/ble

我有一个简单的组合框,源代码附在下面:

<Window x:Class="ComboBoxTest.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    Title="MainWindow" Height="350" Width="525">
<Grid>
    <ComboBox Background="Red" Height="20" Width="50" VerticalAlignment="Top" HorizontalAlignment="Left">
        <ComboBoxItem Content="A"></ComboBoxItem>
        <ComboBoxItem Content="B"></ComboBoxItem>
        <ComboBoxItem Content="C"></ComboBoxItem>
    </ComboBox>
</Grid>

在Windows 7/Server 2008上,组合框以红色背景显示。在Windows 10上运行完全相同的代码或二进制文件时,组合框将丢失红色背景并变为灰色

如何使Win10背景变为红色,并以不会破坏Win7代码的方式执行此操作?

可能的重复