◄CDialog► ◄Up► ◄Contents► ◄Index► ◄Back► ──Microsoft Foundation Classes────────────────────────────────────────────── virtual void OnSetFont( CFont* pFont ); Parameter Description <pFont> Specifies a pointer to the font. If this parameter is NULL, the control will draw text using the default system font. Remarks Specifies which font a dialog-box control is to use when drawing text. The dialog-box font normally gets set in the .RC resource file as part of the dialog-box resource template. If you want to set it instead at run time, specify the DS_SETFONT style in your dialog-box template. With that style set, Windows sends a WM_SETFONT message to the dialog box before creating the controls. The OnSetFont member function is then called automatically via the standard dialog-box procedure. The application should call the ◄CGdiObject::DeleteObject► function to delete the font when it is no longer needed, such as after the control is destroyed. Also call CGdiObject::DeleteObject to delete the old font before you set the new one. The size of the control is not changed as a result of receiving this message. To prevent Windows from clipping text that does not fit within the boundaries of the control, the application should correct the size of the control window before changing the font. For more information about dialog resource templates, see the Windows Software Development Kit documentation. See Also ◄WM_SETFONT► -♦-