This documentation is archived and is not being maintained.

CPropertySheet::Construct 

Constructs a CPropertySheet object.


void Construct(
   UINT nIDCaption,
   CWnd* pParentWnd = NULL,
   UINT iSelectPage = 0 
);
void Construct(
   LPCTSTR pszCaption,
   CWnd* pParentWnd = NULL,
   UINT iSelectPage = 0 
);
void Construct(
   UINT nIDCaption,
   CWnd* pParentWnd,
   UINT iSelectPage,
   HBITMAP hbmWatermark,
   HPALETTE hpalWatermark = NULL,
   HBITMAP hbmHeader = NULL 
);
void Construct(
   LPCTSTR pszCaption,
   CWnd* pParentWnd,
   UINT iSelectPage,
   HBITMAP hbmWatermark,
   HPALETTE hpalWatermark = NULL,
   HBITMAP hbmHeader = NULL 
);

Parameters

nIDCaption

ID of the caption to be used for the property sheet.

pParentWnd

Pointer to the parent window of the property sheet. If NULL, the parent window will be the main window of the application.

iSelectPage

The index of the page that will initially be on top. Default is the first page added to the sheet.

pszCaption

Pointer to a string containing the caption to be used for the property sheet. Cannot be NULL.

hbmWatermark

Handle to the watermark bitmap of the property page.

hpalWatermark

Handle to the palette of the watermark bitmap and/or header bitmap.

hbmHeader

Handle to the header bitmap of the property page.

Call this member function if one of the class constructors has not already been called. For example, call Construct when you declare or allocate arrays of CPropertySheet objects. In the case of arrays, you must call Construct for each member in the array.

To display the property sheet, call DoModal or Create. The string contained in the first parameter will be placed in the caption bar for the property sheet.

You can display watermark and/or header images automatically if you use the third or fourth prototypes of Construct, listed above, and you pass valid values for the hbmWatermark, hpalWatermark, and/or hbmHeader parameters.

The following example demonstrates under what circumstances you would call Construct.

int i;
CPropertySheet   grpropsheet[4];
CPropertySheet   someSheet;   // no need to call Construct for this one

UINT rgID[4] = {IDD_SHEET1, IDD_SHEET2, IDD_SHEET3, IDD_SHEET4};

for (i = 0; i < 4; i++)
    grpropsheet[i].Construct(rgID[i]);
Show: