Solved

Resizing columns in the CListCtrl

Posted on 2000-02-13
1
326 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

630 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