Date: 2009oct6
OS: Windows
Platform: MFC
Language: C/C++
Q. A row is only selected when I click on the label (left item)
in my report mode list control (CListCtrl). Is there a way to fix this?
A. There are a number of ways to do this but the best is to enable LVS_EX_FULLROWSELECT like this:
void EnableNativeFullRowSelect(CListCtrl &list)
{
list.SetExtendedStyle(list.GetExtendedStyle() | LVS_EX_FULLROWSELECT);
}
// Example use
BOOL CMyDlg::OnInitDialog()
{
CDialog::OnInitDialog();
EnableNativeFullRowSelect(m_MyList);
// ...
return TRUE;
}
| What this info useful to you? You can donate to say thanks |
Add a comment
Sign in to add a comment