Visual C++ and MFC Fundamentals Chapter 12: Dialog-Based Windows
CDialog::OnInitDialog();
// TODO: Add extra initialization here
CWnd* Panel = new CStatic;
Panel->CreateEx(WS_EX_STATICEDGE, "STATIC", NULL,
WS_CHILD | WS_VISIBLE, );
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
Sunken Borders: You can further sink the borders of a control, give them an advanced
3 - D appearance. To apply this effect at design time, set the Client Edge property to True.
If you are programmatically creating a control, add the WS_EX_CLIENTEDGE
extended style. Here is an example:
BOOL CBordersDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
CWnd* Panel = new CStatic;
Panel->CreateEx(WS_EX_CLIENTEDGE, "STATIC", NULL,
WS_CHILD | WS_VISIBLE, );
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
Raised Borders: A control appears raised when it borders come out of the client area.
This creates the effect of light left and top borders while the right and bottom borders
appear darker. To apply this property, at design time, set the Modal Frame property to
True or, at run time, add the WS_EX_DLGMODALFRAME extended style. Here is an
example:
BOOL CBordersDlg::OnInitDialog()
{
CDialog::OnInitDialog();