Adding New Resources
Now that you have the application's basic resources the way you want them, it's time toadd the resources that define the application's property sheet. This means creating
dialog box resources for each page in the property sheet. Follow these steps:
1. Click the New Dialog button on the Resource toolbar, or press Ctrl+1, to
create a new dialog box resource. The new dialog box, IDD_DIALOG1, appears in
the dialog box editor. This dialog box, when set up properly, will represent the
first page of the property sheet.
2. Delete the OK and Cancel buttons by selecting each with your mouse and then
pressing Delete.
3. If the Properties box isn't still up, bring it up by choosing View, Properties.
Change the ID of the dialog box to IDD_PAGE1DLG and the caption to Page 1
(see Figure 12.7).
FIG. 12.7 Change the caption and resource ID of the new dialog box.
4. Click the Styles tab of the dialog box's property sheet. In the Style drop-down
box select Child, and in the Border drop-down box select Thin. Turn off the
System Menu check box. Your properties dialog box will resemble Figure 12.8.
The Child style is necessary because the property page will be a child window of
the property sheet. The property sheet itself will provide the container for the
property pages.
FIG. 12.8 A property page uses styles different from those used in regular dialog boxes.
5. Add an edit box to the property page, as shown in Figure 12.9. In most
applications you would change the resource ID from IDC_EDIT1, but for this
demonstration application, leave it unchanged.
6. Create a second property page by following steps 1 through 5 again. For this
property page, use the ID IDD_PAGE2DLG, a caption of Page 2, and add a check box
rather than an edit control (see Figure 12.10).
FIG. 12.9 A property page can hold whatever controls you like.
FIG. 12.10 The second property page looks like this.
No comments:
Post a Comment