Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to keep an item focused in c# listview?

Tags:

c#

listview

i'm trying to keep the last pressed item highlighted in the listview, anyone know how can i do it?

like image 227
Roy Gavrielov Avatar asked Nov 23 '10 15:11

Roy Gavrielov


2 Answers

I'm assuming you want to keep the selected item highlighted when the control loses focus.
Then you should check out the HideSelection property.

like image 53
Sani Singh Huttunen Avatar answered Oct 17 '22 08:10

Sani Singh Huttunen


You can subscribe to the SelectedIndexChanged event and change the selected index/item to the last one.

like image 40
Itay Karo Avatar answered Oct 17 '22 06:10

Itay Karo