开发者

VB.net Listbox Autoscroll

开发者 https://www.devze.com 2023-01-01 05:30 出处:网络
Well I am trying to autoscroll my ListBox or display everything the opposite way just like a shoutbox.

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.


Man try this:

ListBox1.TopIndex = ListBox1.Items.Count - 1

It works. I always use it.


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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消