VB.net 列表框自动滚动

发布于 2024-09-02 18:33:52 字数 99 浏览 5 评论 0原文

好吧,我正在尝试自动滚动我的列表框或以相反的方式显示所有内容,就像喊箱一样。

请在此处发布代码以了解如何执行此操作。我尝试了很多方法,但它们要么给我错误,要么不起作用。

Well I am trying to autoscroll my ListBox or display everything the opposite way just like a shoutbox.

Please post the code here on how to do it. I have tried many ways but they either gave me errors or didn't work.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

甩你一脸翔 2024-09-09 18:33:52

男人试试这个:

ListBox1.TopIndex = ListBox1.Items.Count - 1

它有效。我总是用它。

Man try this:

ListBox1.TopIndex = ListBox1.Items.Count - 1

It works. I always use it.

音盲 2024-09-09 18:33:52

这是我在 vb.net 2008 pro 上使用的,它对我有用。
只需确保您没有将其设置为多选即可。

Me.ListBox1.SelectedIndex = Me.ListBox1.SelectedIndex + 1

This is what I use on vb.net 2008 pro and it works for me.
Just make sure you don't have it set to multi select.

Me.ListBox1.SelectedIndex = Me.ListBox1.SelectedIndex + 1
冧九 2024-09-09 18:33:52

只需使用 ListBox.TopIndex 属性即可。

这是它的帮助:

http:// msdn.microsoft.com/en-us/library/system.windows.forms.listbox.topindex.aspx

或者,您可以将新项目插入到顶部而不是底部。

不过,作为一般提示,如果您在使用 ListBox 执行所需操作时遇到问题,则可能值得在详细信息模式下使用 ListView

Just usethe ListBox.TopIndex property.

Here's the help for it:

http://msdn.microsoft.com/en-us/library/system.windows.forms.listbox.topindex.aspx

Or otherwise you could just insert the new items on the top rather than the bottom.

As a general tip though, if you're having problems getting the ListBox to do what you need, it might be worth using a ListView in details mode instead.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文