Archived

This topic is now archived and is closed to further replies.

kollesofthome

Need help with ListView

Recommended Posts

I''m using a ListView (CListCtrl) in an MFC app. The list has the following styles: LVS_EX_FULLROWSELECT | LVS_EX_HEADERDRAGDROP and view:report. The thing is that when the list losts focus the selected rows get deselected. Maybe not but the background color of the selected rows turns white when you click on a button and then you don''t know which row(s) that were selected. Any style constant I''ve forgotten?

Share this post


Link to post
Share on other sites
Found a way:

DWORD dwStyle = GetWindowLong(m_serverinfo.GetSafeHwnd(), GWL_STYLE);
dwStyle |= LVS_SHOWSELALWAYS;
SetWindowLong(m_mylist.GetSafeHwnd(),GWL_STYLE,dwStyle);

Now the selected rows have grey background. Is it possible to use the blue "highlighted color" instead without ownerdraw?

Share this post


Link to post
Share on other sites