Tuesday, August 11, 2009

Round edged dialog

In dialog .h file

Add member variable

CRgn m_rgn;

In .cpp file in OnInitDialog function insert
this code after the line .....Dialog::OnInitDialog();
-------------------------------------------------------
CRect rect;
GetClientRect(rect);
m_rgn.CreateRoundRectRgn( rect.left, rect.top, rect.right, rect.bottom, 5,5);
SetWindowRgn((HRGN)m_rgn, TRUE);
--------------------------------------------------------

No comments: