Thanks for the article, however I would have appreciated if complete code was availabale as a newbie MFC developer.
Haven't checked all comments, but the code in its original form does not handle mouse scroll wheel actions.
The same code as for OnVScroll and OnHScroll seems to work, except this handler must return a value.
BOOL CMyListCtrl::OnMouseWheel(UINT nFlags, short zDelta, CPoint pt)
if( GetFocus() != this ) SetFocus();
CListCtrl::OnMouseWheel(nFlags, zDelta, pt);
after edit subitem
memory leak occurred.
these leaks same as number of editing subitem.
after create CEdit on heap ,
I Tried delete the CEdit heap memory
please help me
and sorry about my poor english
Of course it does.
Allright, it's not clearly stated in GetKeyState documentation, but if you look at GetKeyboardState you can read: "The low-order bit is meaningless for non-toggle keys."
It's again not clear but it gives me the clue to plain just discard it:
SHORT iCtrlKeyState = GetKeyState( VK_CONTROL ) & 0xFF00; // or 0xFFFE if you preffer
I was wondering if you can post a demo project or the source code for this project as I am having a hard time embedding this code to my project that has a list which i need to edit its subitems.
If you have a column set as right-justified, the code correctly adjusts the edit style to ES_RIGHT so that the edit matches. However, when the edit is drawn, the top of the border is "cut off". I have experimented with this code in several instances and this always happens. If I change the size of the edit in the code (change the rect's top/bottom), it doesn't help until the edit is much larger than the "cell" size. Anyone have a solution?
i'm not able to use the WM_LBUTTONDOWN message for some reason, and so I'm not able to correctly obtain the point of the mouse-click. I have this all implemented using NM_DBLCLK which worked fine when i only had 2 columns and only needed to allow the user to edit the second of the 2. But now I have 3 columns and the user is allowed to edit the last 2 columns, and I can't get this to work because I'm not able to correctly retrieve where the user clicked.