15,979
社区成员
发帖
与我相关
我的任务
分享
// 类似这样就可以了,测试代码
BOOL bDraw = FALSE;
void CXXDlg::OnPaint()
{
CPaintDC dc(this);
if(bDraw)
{
CString str(_T("Hello, World!"));
dc.DrawText(str, CRect(0, 0, 100, 100), DT_CENTER);
}
}
void CXXDlg::OnButton1()
{
// TODO: Add your control notification handler code here
bDraw = TRUE;
Invalidate();
}
void CXXDlg::OnButton2()
{
// TODO: Add your control notification handler code here
bDraw = FALSE;
Invalidate();
}