WPF:删除聚焦的ListView周围的虚线边框

埃罗夫门

当我的应用程序将状态更改为正常时,我想将重点放在我的ListView

private void Window_StateChanged(object sender, EventArgs e)
{
    if (WindowState == WindowState.Normal)
        ListViewUsers.Focus();
}

我很想用Up & Down箭头Keys导航我,ListViewItem而不是单击我的ListView第一个来设置焦点。

因此,除了我在我的框周围有一个虚线边框这一点之外,这还算不错ListView

我尝试将此行添加到我的ListViewItem Style

<Style x:Key="ListBoxItemStyle1" TargetType="{x:Type ListViewItem}"> 
   <Setter Property="FocusVisualStyle" Value="{x:Null}"/> ....

但是不幸的是,我仍然看到这点缀border

有什么建议?

瓦迪姆

这对我来说可以。

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

您如何应用样式?您确定ListView项目使用这种样式吗?

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章