[RESOLVED] Don't scroll Listview when an Item is added?
How can I keep a Listview scrolled to the bottom without any flickering?
With a Listbox, List1.TopIndex = List1.NewIndex works, It doesn't look like it scrolls back up when items are added and then scrolled back down.
Is there such a thing for a ListView?
Using API flickers, LockUpdate doesn't correct it.
Items are constantly being added to the ListView.
Re: Don't scroll Listview when an Item is added?
EnsureVisible is the method name:
Code:
Private Sub Command1_Click()
With ListView1
.ListItems.Add , , "Item" & .ListItems.Count + 1
.ListItems(.ListItems.Count).EnsureVisible
End With
End Sub
Re: [RESOLVED] Don't scroll Listview when an Item is added?
Does the item have to be selected for it to work?
Code:
Dim ItemToAdd As ListItem
Set ItemToAdd = .ListItems.add(, , "hello")
ItemToAdd.SubItems(1) = "asdf"
ItemToAdd.Selected = True
ItemToAdd.EnsureVisible
ItemToAdd.Selected = False
Set ItemToAdd = Nothing
Re: [RESOLVED] Don't scroll Listview when an Item is added?
Quote:
Originally Posted by
ICESTORM
Does the item have to be selected for it to work?
No, it doesn't.
Re: [RESOLVED] Don't scroll Listview when an Item is added?
Seems like it works without selecting with the ListView from Common Controls 6.0
But when using Common Control 5.0, it doesn't work without selecting the item first.
Re: [RESOLVED] Don't scroll Listview when an Item is added?
If it's a new project and you have 6.0 why would you use 5.0? :confused:
Re: [RESOLVED] Don't scroll Listview when an Item is added?
I can't get system theme (manifest file) to work with 6.0.
Re: [RESOLVED] Don't scroll Listview when an Item is added?
I'd rather go with better control than fancy look.