Link to home
Create AccountLog in
Avatar of Thomas Stockbruegger
Thomas StockbrueggerFlag for Germany

asked on

Need some help with ListView scroll

Hello,
I have a ListView with a lot of rows and columns and data.
When I add a new row (which is on the end of the ListView) I have to scroll there manually.
How can I change the ListView that it scrolls automatically there...scroll down to the last new data?
Please help.500 points.
Best regards,
Thomas
ASKER CERTIFIED SOLUTION
Avatar of Zoppo
Zoppo
Flag of Germany image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Dim itm As ListItem

  If listview1.ListItems.Count > 0 Then
    itm = listview1.ListItems.Count - 1
    itm.EnsureVisible
  End If

see  this link
http://www.knowdotnet.com/articles/listviewdragdropscroll.html
UINT nLastItem = GetSelectedCount()
int nSelected = GetNextItem(nLastItem , LVNI_ABOVE | LVNI_SELECTED);
    while( nSelected != -1 )
    {
        DeleteItem(nSelected);
        nSelected = GetNextItem( nSelected, LVNI_ABOVE | LVNI_SELECTED);
    }
Avatar of Thomas Stockbruegger

ASKER

easy and simple....thanks that was the answer I was looking for
thank you Zoppo !!!
You're welcome,

I'm glad I could help ...

Have a nice day,

regards,

ZOPPO
Have a nice day, too.
Best regards,
Thomas