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); return true; }
ReplyBut after edit subitem memory leak occurred. these leaks same as number of editing subitem. maybe after create CEdit on heap , not deleted. I Tried delete the CEdit heap memory But I can't please help me and sorry about my poor english
ReplyOf 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 ...that's allReply
Hi Zafir 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. Thanks Youssef
ReplyHow to Declare the IDC_IPEDIT ?
declare it in Resource.h e.g. #define IDC_IPEDIT 420
ReplyWhat is IDC_IPEDIT ? How to declare it ?
ReplyThis is really a great article! Thanks for posting such a gr8 article! :) ~Vijay.
Replyvery goodReply
Originally posted by: Zack
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?
ReplyOriginally posted by: b_girl
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.
Please help me!!
Thanks.
Reply