Click here to Skip to main content
13,298,965 members (40,123 online)
Rate this:
Please Sign up or sign in to vote.
See more:
After one item is selected in listview, selected mark dissapear as I click other button or space
maybe I think focus is gone also.

Is there any listview style that doesn't lose selected mark even though user click other space?
I couldn't find it in msdn, please give me advice
Posted 1-Dec-12 22:53pm
Richard MacCutchan 2-Dec-12 7:33am
If you click elsewhere then you are taking the focus away from the ListView, so why would it retain it?
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

List-View Window Styles[^]

You probably need to specify LVS_SHOWSELALWAYS when you create the control.

Best regards
Espen Harlinn
Mika Wendelius 12-Dec-12 0:21am
Quite true.
Espen Harlinn 12-Dec-12 9:38am
Thank you, Mika :-D
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Set the HideSelection property[^] of the ListView to false and the selection should always be displayed even when the ListView does not have the focus.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web04 | 2.8.171207.1 | Last Updated 2 Dec 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100