win7, vc6;新建一个单文档工程;最后一步选择视图类的基类为CScrollView;
代码;
void CTestView::OnDraw(CDC* pDC)
{
CTestDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
int i, j, rows;
rows=20;
for(i=1; i<=rows; ++i)
{
for(j=1; j<=i; ++j)
{
pDC->TextOut(10+j*20, 10+i*15, "*");
}
}
}
void CTestView::OnInitialUpdate()
{
CScrollView::OnInitialUpdate();
CSize sizeTotal;
// TODO: calculate the total size of this view
sizeTotal.cx = sizeTotal.cy =