1.2.4 MFC中使对话框变成圆角矩形、椭圆的代码

来源:互联网 发布:vmware mac os 10.9 编辑:程序博客网 时间:2024/05/22 14:22

1.2.4 MFC中使对话框变成圆角矩形的代码

 

BOOLCLoginDlg::OnInitDialog() 

CDialog::OnInitDialog(); 


SetWindowLong(m_hWnd,GWL_HWNDPARENT,NULL);

CRgnm_rgn; 
RECT rc; 
GetWindowRect(&rc); //有边框对话框

//GetClientRect(&rc);//无边框对话框
m_rgn.CreateRoundRectRgn(rc.left,rc.top,rc.right,rc.bottom,100,100); //矩形圆角

//m_rgn.CreateEllipticRgn(rc.left,rc.top,rc.right,rc.bottom);//椭圆
SetWindowRgn(m_rgn,TRUE); 


return TRUE; // return TRUE unless you set the focus to a control 
}

0 0