Solved

CListCtrl scrolling problem

Posted on 2002-06-27
8
545 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 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
 
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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 

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 200 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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
repeatEnd java challenge 42 83
Turn a spreadsheet into a vba executable. 2 66
deburging in oracle form 12 77
Define unique primary key 9 81
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

744 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

15 Experts available now in Live!

Get 1:1 Help Now