Max Frai
Max Frai

Reputation: 64346

ListView on kill focus in mfc

I have a list view in a dialog. When I select some item inside list it's become selected. When I kill focus from list (for example, clicked at another window), the selection disappears. How to make it grayed(inactive) but leave in list?

Upvotes: 0

Views: 649

Answers (1)

dwo
dwo

Reputation: 3636

There is a style called LVS_SHOWSELALWAYS. Set it at runtime using:

DWORD dwStyle = m_list.GetExtendedStyle();
dwStyle |= LVS_SHOWSELALWAYS;
m_list.SetExtendedStyle(dwStyle);

Upvotes: 3

Related Questions