WPF控件 在XP下获得焦点有虚线框

wpf在win7下运行正常,在XP下所有 Button、ListBox等控件获得焦点时有虚线框。如图:选中523这个按钮就出线虚框。

 

我在App.xaml中添加适应所有按钮的样式,无效

<Style  TargetType="{x:Type Button}">
    <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
</Style> 


目前的解决方法只能在没有控件或控件样式 里添加代码:

 <Setter Property="FocusVisualStyle" Value="{x:Null}"/>

稍微麻烦了点,谁有更好的方法? 

原文地址:https://www.cnblogs.com/star250/p/2209748.html