Click here to Skip to main content
15,914,071 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
In Visual Studio MFC, I am trying to create a scrolling window which "freezes" the first line of text as a user is scrolling the window. This type of effect is similar to the "Freeze Panes" effect in Microsoft Excel, where you can keep the first row visible while scrolling downward, so that the user always sees the headers.

I have tried to accomplish this on my own, but I am stuck and I think that what I need is a simple sample program that shows me what to do.

If anyone out there has a sample MFC program that demonstrates this feature, I would greatly appreciate it! Or...you can point me to a place on the Internet that does!

Thanks again for all your help and support!

What I have tried:

Creating my own MFC program and I know that you can catch a windows message whenever someone scrolls the window, but occasionally, it doesn't go to OnDraw, where the text needs to be repainted.
Posted
Updated 10-Mar-17 22:20pm
Comments
[no name] 10-Mar-17 15:31pm    
https://www.google.com/search?q=mfc+fixed+header

1 solution

You just need to modify your OnPaint method so it always paints the same line at the top of the view.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900