对话框由小到大显示的动画效果:
在InitDialog中增加:
ShowWindow(SW_HIDE);
CRect dlgRect;
GetClientRect(&dlgRect);
CPoint centerPoint;
centerPoint.x=dlgRect.Width()/2;
centerPoint.y=dlgRect.Height()/2;//得到对话框的中点坐标
CRgn testrgn;
this->ShowWindow(SW_HIDE);
int m=GetSystemMetrics(SM_CYSIZEFRAME);
//以下代码实现对话框的动态弹出
for (int i=10;i<dlgRect.Width()/2+m;i+=1)
{
testrgn.CreateRectRgn(centerPoint.x-i,centerPoint.y-i,centerPoint.x+i,centerPoint.y+i);
SetWindowRgn((HRGN) testrgn,TRUE);
ShowWindow(SW_SHOW);
CenterWindow();
testrgn.DeleteObject();
}
对话框由小到大显示的动画效果
最新推荐文章于 2022-05-09 17:25:27 发布
