在 Silverlight 列表框中自动滚动 [英] Automatic Scrolling in a Silverlight List Box

查看:29
本文介绍了在 Silverlight 列表框中自动滚动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何以编程方式强制 Silverlight 列表框滚动到底部,以便始终可见添加的最后一项.

How can I programmatically force a silverlight list box to scroll to the bottom so that the last item added is always visible.

我尝试过简单地选择项目.它最终被选中但仍然不可见,除非您手动滚动到它.

I've tried simply selecting the item. It ends up as selected but still not visible unless you manually scroll to it.

推荐答案

使用 ListBox 的 ScrollIntoView 方法传入最后一项.您可能需要在它之前立即调用 UpdateLayout 才能使其工作.

Use the ListBox's ScrollIntoView method passing in the last item. You may need to call UpdateLayout immediately before it for it to work.

这篇关于在 Silverlight 列表框中自动滚动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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