The attribute dialog box is different from the normal dialog box. It provides multiple option pages at the same time, and each page can be edited by the resource editor by editing the dialog box, this facilitates interface development. At the same time, the rules of common dialog boxes are also observed, so it is easy to learn. The Property dialog box consists of two parts: Multiple property pages (CPropertyPage) and Properties dialog box (CPropertySheet ).
First, you need to edit the attribute page, Select Insert in the resource editor, and select the attribute dialog box to insert a property page,,
Or Select Insert a dialog box andSet Style to Child and Border to Thin,.
Then, generate a new class based on the resources in the dialog box and selectCPropertyPage and ClassWizard automatically generate relevant code.
ForCPropertySheet also needs to generate a new class and use all attribute page objects to be added as member variables. The "properties" dialog box can be divided into two types: "Mode" and "Mode". The "Mode property" dialog box is created using DoModal (), and the "Create ()" dialog box is used to Create the "mode property" dialog box. The following code demonstrates how to create a Property dialog box and add a property page:
// Modify the constructor of the CPropertySheet derived class as follows
CSheet: CSheet ()
: CPropertySheet ("test sheet", NULL, 0)
{
M_page1.Construct (IDD_PAGE_1 );
M_page2.Construct (IDD_PAGE_2 );
AddPage (& m_page1 );
AddPage (& m_page2 );
}
// Create a mode Property dialog box
Void CMy56_s1Dlg: OnMod ()
{
CSheet sheet;
Sheet. DoModal ();
}
// Create mode-free attribute dialog box
Void CMy56_s1Dlg: OnUnm ()
{
C