?
Solved

CListCtrl scrolling problem

Posted on 2002-06-27
8
Medium Priority
?
561 Views
Last Modified: 2013-11-20
Hi,
I have a CListCtrl with 5 columns. I want that the horizontal scroll-bar will work only for the first column (I need that all the other 4 columns will be fixed to the right of the CListCtrl).
How do I do it ???

thanks,
Yoav.
0
Comment
Question by:yoavo
[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
8 Comments
 
LVL 12

Expert Comment

by:migel
ID: 7115745
Hi!
you can`t achieve this in the single control without big troubles.
simple solution is to combine two listcontrols side by side and allow scroll only in the first control.
0
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 7115891
I take it allowing the user to resize the columns isn't acceptable?
0
 
LVL 4

Expert Comment

by:mblat
ID: 7117442
I did something simular ( actually I needed to keep first column in place and the rest of them scrolling)

It was done the following way:

1. OnHScroll was overriden and default handler wasn't called.
2. All codes were processed in my handler to find out new desired scrool position. ( There is a good sample on MSDN for that)
3. Column width were obtained.
4. Now tricky part - Columns positions were rearanged via Set/GetColumnOrder and Invalidate()
5. Scroll position were adjusted to make sure that left column were align with control edge.
6. SetScroll() was called.

That gave perfect illusion of scrolling everything but column 0.

Hope it helps.
0
Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

 
LVL 4

Expert Comment

by:mblat
ID: 7117444
By the way it took less than 100 lines of code total - so I wouldn't call it big trouble... :-)
0
 

Author Comment

by:yoavo
ID: 7119586
hi mblat,
can you direct me to the MSDN sample that handle the scrolling ?
0
 
LVL 12

Expert Comment

by:migel
ID: 7119683
hm
I mean that ScrollBar wiil appear only inside first column not at all control under big troubles.
:-)
0
 
LVL 4

Accepted Solution

by:
mblat earned 600 total points
ID: 7120188
There are many:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_mfc_CWnd.3a3a.OnHScroll.asp

for example.....

2 migel: I guess I didn't understand what you meant :-) Peace...
0
 
LVL 12

Expert Comment

by:migel
ID: 7120200
no problem :-)
0

Featured Post

Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Suggested Courses

801 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