-
Hi,
I have a listview that when I select an item in the list that is not the first item in the list, the first item will allways, momentarily highlight then it will jump to the item that I actually clicked on..
This is probably something to do with focus but I can't figure it out... Functionally it's not a problem but it just looks plain cheesy!!!!
Any idea what's causing this?
Thanks,
Dan
-
Hey Dan,
I actually posted the same question a while back and didn't get it fixed. Later, I got it working on my own. I have a lot of code in my listView's MouseDown event, but I think this is the part that solves the problem. Let me know if it doesn't and I'll experiment more.
Basically you want to deselect that first item real quick when the listView gets the focus.
Dim lvItem As ListItem
Set lvItem = lvFiles.HitTest(x, y)
If Not (lvFiles.SelectedItem Is Nothing) Then
lvFiles.SelectedItem.Selected = False
Set lvFiles.SelectedItem = Nothing
End If
If Not (lvItem Is Nothing) Then
Set lvFiles.SelectedItem = lvItem
End If
-
Thanks, will try it out and let you know how it worked..