How could I Add Minimize and Maximize box to the system menu of CMFCPropertySheet
.
I have tried modifying the style by
CMFCPropertySheet::ModifyStyle(NULL, WS_SYSMENU);
but nothing happened.
Step 1 − Right-click on your project and select Add > Class menu options. Step 2 − Select Visual C++ → MFC from the left pane and MFC Class in the template pane and click Add. Step 3 − Enter the class name and select CPropertySheet from base class dropdown list. Step 4 − Click finish to continue.
A property sheet, also known as a tab dialog box, provides a way to manage large numbers of controls in a dialog box. The property sheet contains property pages, each based on a separate dialog template resource. You can divide your dialog box's controls into logical groups and put each group on its own property page.
Assuming you have a class derived from CPropertySheet, let's call it MySheet:
// Capture the WM_NCREATE message
BEGIN_MESSAGE_MAP(CMySheet, CPropertySheet)
ON_WM_NCCREATE()
END_MESSAGE_MAP()
BOOL CMySheet::OnNcCreate(LPCREATESTRUCT lpCreateStruct)
{
if (!CPropertySheet::OnNcCreate(lpCreateStruct))
return FALSE;
// Modify the window style
LONG dwStyle = ::GetWindowLong(m_hWnd, GWL_STYLE);
::SetWindowLong(m_hWnd, GWL_STYLE, dwStyle | WS_WS_MINIMIZEBOX | WS_MAXIMIZEBOX);
return TRUE;
}
Note that you could do this in the OnInitDialog, but even though the Minimize/Maximize boxes will show, they won't do anything.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With