INFO: Correct Use of the SetFont() Function in MFC (85518)
The information in this article applies to:
- The Microsoft Foundation Classes (MFC), when used with:
- Microsoft C/C++ for MS-DOS 7.0
- Microsoft Visual C++ for Windows, 16-bit edition 1.0
- Microsoft Visual C++ for Windows, 16-bit edition 1.5
- Microsoft Visual C++ for Windows, 16-bit edition 1.51
- Microsoft Visual C++ for Windows, 16-bit edition 1.52
- Microsoft Visual C++, 32-bit Editions 1.0
- Microsoft Visual C++, 32-bit Editions 2.0
- Microsoft Visual C++, 32-bit Editions 2.1
- Microsoft Visual C++, 32-bit Editions 4.0
This article was previously published under Q85518 SUMMARY
The SetFont() member function of the CWnd class changes the font in a
specified control. For this function to work correctly in a Windows-
based application, you must ensure that the CFont object specified in
the SetFont() call is not destroyed until after the specified control
has been destroyed.
Modification Type: | Major | Last Reviewed: | 12/8/2003 |
---|
Keywords: | kbinfo KbUIDesign KB85518 |
---|
|