Solved

Resizing columns in the CListCtrl

Posted on 2000-02-13
1
321 Views
Last Modified: 2008-03-10
I need to do inposible resizing columns in the CListCtrl.
What can I do?
0
Comment
Question by:atkach
1 Comment
 
LVL 4

Accepted Solution

by:
inpras earned 100 total points
ID: 2517870
Hi
Derive UR on Class from CListCtrl and in the derived class add the following function and code
lets say CDontResize
BOOL CDontResize::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult)
{

      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, lParam, pResult);
}


This is for columns mentioned above viz 2, 3, 4, 5, 6, 7, 8 do the same for the columns U wish not to resize
Hope this helps
inpras
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now