Visual C++ and MFC Programming 2nd Edition

(Martin Jones) #1

Chapter 12: Dialog-Based Windows Visual C++ and MFC Fundamentals



  1. Click Finish

  2. On the dialog, click TODO and press Delete three times to delete the TODO line, the
    OK and the Cancel buttons

  3. While the dialog box is displaying, access its properties.
    Change its ID to IDD_QUADRILATERAL
    If necessary, change its Caption to Quadrilateral
    Change its Style value to Child
    Change its Border to Thin
    Remove the check mark of the System Menu check box or set it to False
    Set its Visible property to False or remove its check mark
    If necessary, remove the check mark of the Disabled check box or set it to False

  4. Save All

  5. From the Controls toolbox, click the Edit Box button and click anywhere in the
    dialog box

  6. Open the header file of the dialog
    Change its base class to CPropertyPage
    Change the value of the IDD to IDD_QUADRILATERAL


class CQuadrilateral : public CPropertyPage
{
// Construction
public:
CQuadrilateral(CWnd* pParent = NULL); // standard constructor

// Dialog Data
//{{AFX_DATA(CQuadrilateral)
enum { IDD = IDD_QUADRILATERAL };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA


  1. Change the source file of the CQuadrilateral class as follows:


// Quadrilateral.cpp : implementation file
//

#include "stdafx.h"
#include "Geometry.h"
#include "Quadrilateral.h"
Free download pdf