Click to See Complete Forum and Search --> : Converting CView to CScrollView
Mahesh Chari
May 20th, 1999, 11:14 AM
Hi,
Can someone tell me the steps to convert a class derived from CView to one derived from CScrollView (without rebuilding the whole app using appwizard, if possible). I want the scroll bars in my application to work.
Thanks
regards,
mc
ZeroCool
May 20th, 1999, 11:25 AM
Go and have a look at the help section on CScrollBar::Create. You d'ont have to canvert anything, you just have to add the bars to your view.
smakadia
May 20th, 1999, 02:19 PM
Another way you can do this is wherever you see the word CView, replace it with CScrollView. That should do it, I think.
Mahesh Chari
May 21st, 1999, 03:57 PM
No replacing CView with CScrollView alone will not work...some more adjustments have to be made (that I don't know of)...
thanks.
mc
nlarson
April 6th, 2009, 04:17 PM
1. Everywhere you see CView change it to CScrollView.
2. Add the following to the void CYOURNAMEView::OnInitialUpdate()
// TODO: calculate the total size of this view
CSize sizeTotal;
sizeTotal.cx = sizeTotal.cy = 100;
SetScrollSizes(MM_TEXT, sizeTotal);
That seems to be the only difference between an app wizard generated CScrollView app and and an app wizard generated CView app.
Then you need to make all the changes that deal with scrolling.
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.