View selected item in listView

  • Thread starter Thread starter Alberto
  • Start date Start date
A

Alberto

I select an item in a listView by code and it works fine (thanks to Morten
Wennevik who tell me how to do it) but if the item is out of screen (there
are a lot of items) I'd like to see it selected. Actually, the item is
selected but I can't see because is out of screen.

Thank you.
 
Hi Alberto,

Add EnsureVisible(lst.FocusedItem.Index); to each key in the switch.

....
lst.EnsureVisible(lst.FocusedItem.Index);
e.Handled = true;
break;
....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top