Click to See Complete Forum and Search --> : How to program scrol funstions


jxu
May 27th, 1999, 12:08 PM
I found you are very familiar with the Scroll function, I have a question:
I try to add a control into a dialog. The function of the control
is similar to the CScrollView. But I found that I cannot
use CScrollView as the basic class of the control.
So I use Cwnd and declare class CscrollCtrl:public CWnd;
I added the scrollbar into the control.
But the problem is I really don't know how to do this.
such as, if the client area (visible area) of the class(CscrollCtrl)
is ((0,0),(100,100)), how to setup the scroll area as ((0,0),(200,200))?
and then, how to use CDC member function (such as Line(..)) to draw in that scroll area?
finally, how to show such unvisible area in the scroll area when call OnHScroll(..), OnVScroll(..)

If you can teach me that, please tell me ASAP. If you can, could u provide some simple sample code?
I really appreciate that!
Thanks very much!