logo search
Учебник_ПОА

To display the font dialog box

  1. On the File menu, click New Project.

The New Project dialog box appears.

  1. Click Windows Forms Application and then click OK.

  2. From the Toolbox, drag a Label control to the form, and change the following properties in the Properties window:

    Property

    Value

    Name

    labelFont

    Text

    Sample text

  3. Add a Button control to the form, and change the following properties in the Properties window:

    Property

    Value

    Name

    setFont

    Text

    Change Font

  4. Drag a FontDialog component from the Dialogs tab of the Toolbox to the form.

fontDialog1 appears in the component tray.

  1. Double-click the button to create the default event handler in the Code Editor.