On Mon, 4 Apr 2005 17:40:35 +0800, cyshao wrote:
How to control the scroolbar.locat ion of ListView?
I have a ListView with many items.
I want to locate ListView scrollBar to bottom, top, or some item.
How can I do that ?
You could do something like this:
Setting it to the top:
ListViewItem firstItem = _lstTest.Items[0];
firstItem.Ensur eVisible();
Setting it to the bottom:
ListViewItem lastItem = _lstTest.Items[_lstTest.Items. Count - 1];
lastItem.Ensure Visible();
So the secret is "EnsureVisible( )". If you have the ListViewItem just call
EnsureVisible() .
hth
--
Claudio Grazioli
http://www.grazioli.ch