要不,OnUpdate重载了没?像这样 void CaaaView::OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint) { // TODO: Add your specialized code here and/or call the base class // TODO: Add your specialized code here and/or call the base class CScrollView::OnUpdate(pSender,lHint,pHint); CSize sizeTotal;
void CaaaView::OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint)
{
// TODO: Add your specialized code here and/or call the base class
// TODO: Add your specialized code here and/or call the base class
CScrollView::OnUpdate(pSender,lHint,pHint);
CSize sizeTotal;
sizeTotal.cx =100
sizeTotal.cy =200
SetScrollSizes(MM_TEXT, sizeTotal);
}
{
CPaintDC dc(this);CRect rect;
GetClientRect(rect);
DocToClient(rect);
...
}
void CYourView::DocToClient(CRect& rect)
{
CClientDC dc(this);
OnPrepareDC(&dc, NULL);
dc.LPtoDP(rect);
rect.NormalizeRect();
rect.bottom += 1980;
//rect.top -= 198;
}