?
Solved

CListCtrl scrolling problem

Posted on 2002-06-27
8
Medium Priority
?
581 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
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 45

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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
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

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

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses
Course of the Month15 days, 4 hours left to enroll

840 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