• Advertisement

Archived

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

Need help with ListView

This topic is 5643 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
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

  • Advertisement