CListCtrl - Selected Item
-
I use a CListCtrl object that, by default, should display Item No. 0 as selected. The Item ist displayed with a light grey background, when I click on an item is is displayed with a much darker background. How can I change the light grey to dark grey ?
m_Companies.SetItemState( 0, LVIS_SELECTED, LVIS_SELECTED | LVIS_FOCUSED); m_Companies.EnsureVisible( 0, FALSE);
-
I use a CListCtrl object that, by default, should display Item No. 0 as selected. The Item ist displayed with a light grey background, when I click on an item is is displayed with a much darker background. How can I change the light grey to dark grey ?
m_Companies.SetItemState( 0, LVIS_SELECTED, LVIS_SELECTED | LVIS_FOCUSED); m_Companies.EnsureVisible( 0, FALSE);
if the item gets light gray but not dark gray, it means CListCtrl doesn't get focus. use: myList.SetFocus() to set focus on the CListCtrl.
A nice tool for optimizing your Microsoft html-help contents. Includeh10