yakky
asked on
CListCtrl - How do I prevent a user resizing the columns & stop the blue hilighter appearing when an item is clicked on?
CListCtrl -
1. How do I prevent a user resizing the columns?
2. Stop the blue hilighter appearing when an item is clicked on?
I can do this if I invalidate the window, but the windows background becomes greyed. I want a white background. Any ideas?
Thanks in Advance
Yakky
1. How do I prevent a user resizing the columns?
2. Stop the blue hilighter appearing when an item is clicked on?
I can do this if I invalidate the window, but the windows background becomes greyed. I want a white background. Any ideas?
Thanks in Advance
Yakky
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Hi,
To prevent selection u can map the WM_LBUTTONDOWN message to that class and dont call the base class member. That also will work.
Try it out.
VinExpert
To prevent selection u can map the WM_LBUTTONDOWN message to that class and dont call the base class member. That also will work.
Try it out.
VinExpert
ASKER
Thanks a lot
Yakky
Yakky
Not to allow user to resize.
Have Ur own List Control class say CDontResize and associate it with ur list control. Then map the following function
BOOL CDontResize::OnNotify(WPAR
{
HD_NOTIFY *pHDN = (HD_NOTIFY*)lParam;
{
if((pHDN->hdr.code == HDN_BEGINTRACKW || pHDN->hdr.code == HDN_BEGINTRACKA)
&& (pHDN->iItem == 2) || (pHDN->iItem == 3) || (pHDN->iItem == 4) ||
(pHDN->iItem == 5) || (pHDN->iItem == 6) || (pHDN->iItem == 7) || (pHDN->iItem == 8))
{
*pResult = TRUE;
return TRUE;
}
}
return CListCtrl::OnNotify(wParam
}
Here I am not allowing the columns 2 - 8 to resize!!!.
Try it out.
VinExpert