Use Properties dialog box

Source: Internet
Author: User

 

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.