This topic has not yet been rated - Rate this topic

CFontDialog::DoModal

Call this function to display the Windows common font dialog box and allow the user to choose a font.

virtual INT_PTR DoModal( );

Return Value

IDOK or IDCANCEL. If IDCANCEL is returned, call the Windows CommDlgExtendedError function to determine whether an error occurred.

IDOK and IDCANCEL are constants that indicate whether the user selected the OK or Cancel button.

Remarks

If you want to initialize the various font dialog controls by setting members of the m_cf structure, you should do this before calling DoModal, but after the dialog object is constructed.

If DoModal returns IDOK, you can call other member functions to retrieve the settings or information input by the user into the dialog box.

Example

See the examples for CFontDialog::CFontDialog and CFontDialog::GetColor.

See Also

CFontDialog Overview | Class Members | Hierarchy Chart | CDialog::DoModal | CFontDialog::CFontDialog

Did you find this helpful?
(1500 characters remaining)
© 2013 Microsoft. All rights reserved.