CListCtrl scrolling problem

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.
yoavoAsked:
Who is Participating?
 
mblatCommented:
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
 
migelCommented:
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
 
AndyAinscowFreelance programmer / ConsultantCommented:
I take it allowing the user to resize the columns isn't acceptable?
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
mblatCommented:
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
 
mblatCommented:
By the way it took less than 100 lines of code total - so I wouldn't call it big trouble... :-)
0
 
yoavoAuthor Commented:
hi mblat,
can you direct me to the MSDN sample that handle the scrolling ?
0
 
migelCommented:
hm
I mean that ScrollBar wiil appear only inside first column not at all control under big troubles.
:-)
0
 
migelCommented:
no problem :-)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.