CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    May 1999
    Posts
    11

    Converting CView to CScrollView

    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


  2. #2
    Join Date
    May 1999
    Posts
    23

    Re: Converting CView to CScrollView

    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.


  3. #3
    Join Date
    May 1999
    Location
    CT
    Posts
    75

    Re: Converting CView to CScrollView

    Another way you can do this is wherever you see the word CView, replace it with CScrollView. That should do it, I think.


  4. #4
    Join Date
    May 1999
    Posts
    11

    Re: Converting CView to CScrollView

    No replacing CView with CScrollView alone will not work...some more adjustments have to be made (that I don't know of)...

    thanks.

    mc


  5. #5
    Join Date
    Sep 2007
    Posts
    1

    Re: Converting CView to CScrollView

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured