ListView问题 [英] ListView problem

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

问题描述

您好,


任何人都知道如何按代码向下滚动列表视图?

例如。我在listview中有200个项目。当我将selectedItem设置为

item 180时,如果用户不能将其向下滚动,则用户无法看到它。


谢谢!

解决方案

使用EnsureVisible方法。传递你想要的项目的索引

滚动到视图。

-

____________________

克劳斯H. Probst,MVP
http://www.vbbox.com/


" alan" < ab*@hotmail.com>在消息中写道

news:u%**************** @ TK2MSFTNGP11.phx.gbl ...

你好,

任何人都知道如何按代码向下滚动列表视图?
例如。我在listview中有200个项目。当我将selectedItem设置为
为项目180时,如果用户不能将其向下滚动,则用户无法看到它。

谢谢!




嗨Alan,


感谢您在此群组中发帖。

您可以使用ListView.EnsureVisible方法强制listview自动滚动到

您想要的项目。


如果您要确保的项目可见,则位于上方ListView控件的

可视区域,调用EnsureVisible方法

将滚动控件的内容,直到它是
$ b $中的第一项b可视区域的控制。如果该项目位于ListView控件的可查看区域下方,则调用EnsureVisible方法将滚动ListView控件的

内容,直到该项目为该项目中的最后一项。

可视区域的控件。


希望这会有所帮助,


祝你好运,

Jeffrey Tan

Microsoft在线合作伙伴支持

安全! - www.microsoft.com/security

此帖子按原样提供没有保证并且没有权利。


使用EnsureVisible方法。传递你想要的项目的索引

滚动到视图。

-

____________________

克劳斯H. Probst,MVP
http://www.vbbox.com/


" alan" < ab*@hotmail.com>在消息中写道

news:u%**************** @ TK2MSFTNGP11.phx.gbl ...

你好,

任何人都知道如何按代码向下滚动列表视图?
例如。我在listview中有200个项目。当我将selectedItem设置为
为项目180时,如果用户不能将其向下滚动,则用户无法看到它。

谢谢!


Hello,

Anyone know how to scroll down the listview by code?
Eg. I have 200 items in the listview. When I set the selectedItem to be
item 180, the user cannot see it if he don''t scroll it down.

Thanks!

解决方案

Use the EnsureVisible method. Pass in the index of the item you want to
scroll into view.
--
____________________
Klaus H. Probst, MVP
http://www.vbbox.com/

"alan" <ab*@hotmail.com> wrote in message
news:u%****************@TK2MSFTNGP11.phx.gbl...

Hello,

Anyone know how to scroll down the listview by code?
Eg. I have 200 items in the listview. When I set the selectedItem to be item 180, the user cannot see it if he don''t scroll it down.

Thanks!




Hi Alan,

Thanks for posting in this group.
You can use ListView.EnsureVisible method to force listview auto scroll to
your wanted item.

If the item that you want to ensure is visible is located above the
viewable region of the ListView control, calling the EnsureVisible method
will scroll the contents of the control until it is the first item in the
viewable area of the control. If the item is below the viewable region of
the ListView control, calling the EnsureVisible method will scroll the
contents of the ListView control until the item is the last item in the
viewable area of the control.

Hope this helps,

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.


Use the EnsureVisible method. Pass in the index of the item you want to
scroll into view.
--
____________________
Klaus H. Probst, MVP
http://www.vbbox.com/

"alan" <ab*@hotmail.com> wrote in message
news:u%****************@TK2MSFTNGP11.phx.gbl...

Hello,

Anyone know how to scroll down the listview by code?
Eg. I have 200 items in the listview. When I set the selectedItem to be item 180, the user cannot see it if he don''t scroll it down.

Thanks!



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

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