1

I'm working on an SDI app without Doc/View structure. I have spent so much time on this project, and now I would like to implement vertical & horizontal scroll bars (not mandatory, but they can be so useful).

I've been searching for it, and the only way to do this (apparently) is working with the CScrollView class, is that true? or there is anyway to implement the scrollbars in my CChildView?

I need them because I've added a zoom in & out utility with the Stretchblt function, and when the view is zoomed, I want to scroll over in order to focus what I want to see. Any idea to do that?

If I have to recode all.. I prefer to finish this without the scrollbars.

Sorry for my english, and thank you!

JDV
  • 21
  • 4
  • It is possible to implement scrolling without using the CScrollView class. After all, the folks who wrote CScrollView did it. Putting scroll bars on your window is just a matter of setting the right style bits. But then you have to do a lot of work - have a look at the source code of CScrollView to see if you can understand what it does. – ScottMcP-MVP Jul 25 '13 at 20:04

1 Answers1

1

First of all you are using SDI application then there should be one class inherited from CWnd class to show some thing. As you said you don't have Doc\View Architecture indicates you don't have class like SCrollView. To implement scrollbar to CWnd or an dialog control there is one beautiful article in codeproject please referred it ,

Add Scrolling to a CWnd or CDialog using a C++ Helper Class

Santosh Dhanawade
  • 1,756
  • 14
  • 29