Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. scroll the document?

scroll the document?

Scheduled Pinned Locked Moved C / C++ / MFC
data-structuresquestion
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    Nelson L
    wrote on last edited by
    #1

    Hi, I made a small project and draw a graph and write a few lines on the display using CScrollView, the scrollbar works when the text exceed the windows. To work on the print preview, after adding the following, the print preview looks ok, but the display fails even when I move the thumb scroll bar. void CReaderView::OnPrepareDC(CDC* pDC, CPrintInfo* pInfo) { if (pDC->IsPrinting()) { int pageHeight = pDC->GetDeviceCaps(VERTRES); int OriginY = pageHeight * (pInfo->m_nCurPage-1); pDC->SetViewportOrg(0, -OriginY); } CView::OnPrepareDC(pDC, pInfo); } I tried to add a WM_VSCROLL, and change the ViewportOrg, seems not working. I also found if I replace the last line with CScrollView::OnPrepareDC(pDC, pInfo); the effect is reversed. Anyone could give me some hints on this? Thanks.

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups