How to select a full row in a CListCtrl?
Thanks in advance.
Printable View
How to select a full row in a CListCtrl?
Thanks in advance.
DWORD dwStyleEx = pListCtrl->GetExtendedStyle();
dwStyleEx |= LVS_EX_FULLROWSELECT;
pListCtrl->SetExtendedStyle(dwStyleEx);
That works fine if you're using VC6, but GetExtendedStyle and SetExtendedStyle weren't supported in previous incarnations of VC. This will do the same thing (plus add header drag-drop and gridlines) for a list control. If you're using a list view, run this in your OnCreate override and drop the "m_list." prefix to SendMessage (tested with VC5).
// Assuming CListCtrl m_list;
int nStyleEx = LVS_EX_HEADERDRAGDROP | LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES;
m_list.SendMessage(LVM_SETEXTENDEDLISTVIEWSTYLE, nStyleEx, nStyleEx);
is there an equivalent to these functions in vc++ 5.0
Hi,
Add this line it will work.
//m_List is your CListCtrl
m_List.SendMessage(LVM_SETEXTENDEDLISTVIEWSTYLE, 0, LVS_EX_FULLROWSELECT);
Regards,
Joel.