scroll the document?
-
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.