Share via


Add the Controls

This procedure assumes you have the property page open, the pushpin "clicked," and the IDD_PEN_WIDTHS dialog resource open in the dialog editor.

To add controls to the Pen Widths dialog box

  1. From the Controls toolbar, add two edit box controls to the Pen Widths dialog box.

    • Select the first edit box to display its property page. Change its ID to IDC_THIN_PEN_WIDTH.

    • Select the second edit box, and in the property page change its ID to IDC_THICK_PEN_WIDTH.

  2. From the Controls toolbar, add two static text controls to contain the descriptions for the two edit controls.

    • Select the first text box to display its property page. Change the caption to Thin Pen Width:.

    • Select the second text box, and in the property page change its caption to Thick Pen Width:.

    For the purposes of Scribble, you won’t have to refer programmatically to the IDs of the text boxes, so you can leave them with their default values (both have the value IDC_STATIC).

  3. From the Controls toolbar, add a third button to the two already present.

  4. Select the third button to display its property page. Change its ID to IDC_DEFAULT_PEN_WIDTHS and its caption to Default.

    The handler for this button will reset the thick and thin pens to their default widths.

The following figure illustrates designing the Pen Widths dialog box. In this illustration, the central window is the dialog editor window. The property page is below the dialog editor, and the Controls toolbar is to the right of the dialog editor.

Designing the Pen Widths Dialog Box