正确答案: The invalidated areas accumulate in the update region until the region is processed when the next WM_PAINT message occurs or until the region is validated by using the ValidateRect or ValidateRgn function. The system sends a WM_PAINT message to a window whenever its update region is not empty and there are no other messages in the application queue for that window.
或者Invalidate()
{
CRect rc;
GetClientRect(&rc);
CClientDC DC(this);
Invalidate();
DC.DrawText("Jay",&rc,DT_CENTER);
}
按理说,应该是先刷新视图区,再显示一下Jay的!!!
可是怎么没有????请给以解释!!!!
关于绘图的部分应该写在这个函数里面
现在已经是你所要表达的的啦...就是先刷新视图区.再显示了..
/////////////////////////////////////没有啊??????
我这里试完了,就是白茫茫一片呀?????????????
这个函数会调用CXXVIEW::ondraw(cdc* p);
里边没有你的DC.DrawText("Jay",&rc,DT_CENTER);代码
建议Invalidate(),再UpdateWindow()试试
的确有用!!!!!但是为什么呢?单一使用Invalidate()不管用????
你想刷新什么,都写在ONDRAW里面
什么时候想刷新,就调用INVALIDATE
The invalidated areas accumulate in the update region until the region is processed when the next WM_PAINT message occurs or until the region is validated by using the ValidateRect or ValidateRgn function. The system sends a WM_PAINT message to a window whenever its update region is not empty and there are no other messages in the application queue for that window.