MFC VC++: How to keep focus mark or selection mark when CListCtrl does not have focus

StackOverflow https://stackoverflow.com/questions/20444870

  •  30-08-2022
  •  | 
  •  

Pergunta

I have 2 List controls side by side in my view area. When I select an item in list1, the list2 is populated. When an item is selected in list2, details are displayed in another view besides it.

So when an item is selected in list2, list1 looses its selected state and focused states(markers).

How to keep the item highlight in list1 after focus is moved away?

Foi útil?

Solução

When constructing the List View control, specify the LVS_SHOWSELALWAYS. This will display the selected item(s) regardless of whether or not the control has input focus.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top