WPF ListView ScrollBar可见为false [英] WPF ListView ScrollBar visible to false

查看:221
本文介绍了WPF ListView ScrollBar可见为false的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在需要时强制水平(或垂直)滚动不显示?

Is it possible to force the horizontal (or vertical) scroll to NOT display even when needed?

问题是我需要根据项目显示不同的颜色.效果很好,但是您可以清楚地看到颜色没有达到列表视图的两个边缘,这有点难看.更糟的是,我的listview中有另一个listview,其中包含另一个项目列表.这些项目的背景甚至还没有接近列表视图的边缘.

The thing is that I need to display colors that are different depending of the item. That works fine but you can clearly see that the color does not reach both edge of the list view, which is kinda ugly. To make things worse, I have in my listview another listview that contains another list of item. Those item's background does not come even close to the edge of the listview.

推荐答案

您可以使用ScrollViewer.HorizontalScrollBarVisibilityScrollViewer.VerticalScrollBarVisibility附加属性为垂直和水平滚动到四个选项指定滚动条的可见性:AutoDisabledHiddenVisible.

You can specify the visibility of the scrollbar for both vertical and horizontal scrolling to four options, using the ScrollViewer.HorizontalScrollBarVisibility and ScrollViewer.VerticalScrollBarVisibility attached properties: Auto, Disabled, Hidden and Visible.

<ListView ScrollViewer.HorizontalScrollBarVisibility="Disabled">

Disabled将使其从不显示且无法滚动,Hidden将使其不显示,但允许用户使用文本选择和箭头键/鼠标轮等进行滚动.

Disabled will have it never show up and scrolling is not possible, Hidden will have it not show, but will allow users to scroll using text selection and arrow keys/mousewheel, etc.

这篇关于WPF ListView ScrollBar可见为false的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆