I have tried using the CStatic::Create() and CWnd::CreateEx().
They did create the rectangle but without the top left corner text.
Also, it does not have the 3D style like those created using the Dialog
Editor.
Appreciate any hints and help.
Jackson Ho
To create the Group box you have to use the CButton class. One of the button
style BS_GROUPBOX, helps you to create the group box.
May be you can try the following code in the OnInitDialog() of your dialog
class and OnCreate() function of your own derived button class.
////////////////////////////////////////////////////////////////////////////
//////////
BOOL CMyOwnDlg::OnInitDialog()
{
CDialog::OnInitDialog();
CGroupButton *m_button;
m_button = new CGroupButton();
CRect m_rec(10,10,150,80);
m_button->Create("Select",WS_CHILD | WS_VISIBLE | BS_GROUPBOX,m_rec,
this, ID_MYBUTTON);
return TRUE;
}
////////////////////////////////////////////////////////////////////////////
//////////////
int CGroupButton::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CButton::OnCreate(lpCreateStruct) == -1)
return -1;
CRect m_rec2(10,20,30,30);
CButton *m_button;
m_button = new CButton();
m_button->Create(NULL, WS_CHILD | WS_VISIBLE | BS_LEFTTEXT
|BS_RADIOBUTTON,m_rec2,
this, ID_MYRADBUTTON);
return 0;
}
////////////////////////////////////////////////////////////////////////////
///////
Hope this helps you
Regards
Vijayaraghavan Nair
Email: Vija...@e-supportpoint.com
www.e-supportpoint.com
Jackson Ho wrote in message ...
Just a couple of comments:
You can just look at the .rc file generated for the resource editor to see which
style you're missing in your call to CStatic::Create().
As for the text, Are you calling SetWindowText() after creating the control?
--
Tomas Restrepo
win...@bigfoot.com
http://members.xoom.com/trestrep/
Jackson Ho <jacks...@glenayre.com> wrote in message
news:eobiFJst#GA....@cppssbbsa02.microsoft.com...