在OnPaint()函数的else中,写上: CRect rc; GetClientRect(&rc); // 获取客户区 CPaintDCdc(this); dc.FillSolidRect(&rc, RGB(0, 160, 0));