Hi
How can I set the focus on the last item in the listview control?
item.selected=true doesnt set it focused. :)
Printable View
Hi
How can I set the focus on the last item in the listview control?
item.selected=true doesnt set it focused. :)
listview1.listitems(listview1.listitems.count).selected = true
not working... while the listview is being populated.Quote:
Originally Posted by leinad31
does the listview have the focus? If you want the selected item to be highlighted even when listview loses focus.
ListView1.HideSelection = False
If your listview is set to muliselection then you'll have to use EnsureVisible
And if its while being populated, then set the listitem's Selected property and call ensurevisible just after being added.
Use this syntax so you have a reference, in this case lstNew holds the reference to the just added listitem
VB Code:
Dim lstNew As ListItem Set lstNew = ListView1.ListItems.Add lstNew.Text = "Test" lstNew.Selected = True lstNew.EnsureVisible
WORKING................... PROBLEM SOLVED!Quote:
Originally Posted by leinad31
eh? check everything... are you sure the listview is enabled? are you sure it can receive focus (on the active form), or you can select items with clicks? are you sure you don't have code elsewhere that's setting selected = false and setting listview1.selecteditem = nothing?
and post the code for populating it.
ITS WORKING! THANKS! YOU ROCK! (y)Quote:
Originally Posted by leinad31
Ok. Pls take the time to mark the thread as resolved