无法在 mfc 应用程序中创建 GroupBox
Cannot create GroupBox in mfc app
CPanel * CWnd;
...
CPanel = new CWnd();
CPanel->Create(TEXT("STATIC"), L"PANELпанелька", WS_CHILD | WS_VISIBLE|BS_GROUPBOX,
CRect(100, 100, 300, 300), this, 1234);
CPanel->SetWindowTextW(L"XFDSF");
编译后我只得到一个没有标题的带有 1px 灰色边框的正方形。我做错了什么?
Groupbox 是 CButton。这个有效:
CButton *m_button;
m_button = new CButton();
CRect m_rec(10,10,150,80);
m_button->Create(L"Select",WS_CHILD | WS_VISIBLE | BS_GROUPBOX,m_rec, this, ID_BUTTON1);
CPanel * CWnd;
...
CPanel = new CWnd();
CPanel->Create(TEXT("STATIC"), L"PANELпанелька", WS_CHILD | WS_VISIBLE|BS_GROUPBOX,
CRect(100, 100, 300, 300), this, 1234);
CPanel->SetWindowTextW(L"XFDSF");
编译后我只得到一个没有标题的带有 1px 灰色边框的正方形。我做错了什么?
Groupbox 是 CButton。这个有效:
CButton *m_button;
m_button = new CButton();
CRect m_rec(10,10,150,80);
m_button->Create(L"Select",WS_CHILD | WS_VISIBLE | BS_GROUPBOX,m_rec, this, ID_BUTTON1);