If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register or Login
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

inmovable scrollbars

I'm learning on my own how drawing icons, scaling, and scrolling using Visual C++. My project is to place any icon in the child window, zoom in or out, and scroll anywhere. I am able to place icons with a rectangle around the icon, zoom in (out is just as easy and I'll include it later), BUT I can't scroll. The scroll bars will change size as I zoom in. However, the scroll bars don't scroll but return to their original location after I try to drag them even though they change size depending on the scale I'm using. What can I do? I included the relevant parts of code in CScrollView as I don't use the CDocument or anything else.

Here's my OnPrepareDC code. I use GetClipBox to cause window extent to be the size of visible window instead of a CSize variable in the document as most examples use. I make sure to subtract the BottomRight from the TopLeft so that the BottomRight is larger than normal in the I have scrolled as in VRx and VRy.

Re: inmovable scrollbars

Hard to understand code without [code][/code] tag...

Anyway, I don't think you can call directly OnPrepareDC()... It is called by the framework when it is needed, in response to an appropriate window message being sent where needed... I suggest not to mess with function that start with On---, because they are message handlers, and usually don't work outside their context