[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

CListCtrl scrolling problem

Posted on 2002-06-27
8
Medium Priority
?
571 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 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
Independent Software Vendors: 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!

 
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
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.
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

650 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