PRB:CFormView/Dialogs Sized Larger Under Win32s/WinNT 3.50Last reviewed: July 10, 1997Article ID: Q157142 |
2.00 2.10 2.20 4.00 4.10
WINDOWS NT
kbprg kbtool kbprb
The information in this article applies to:
SYMPTOMSCFormViews and Dialogs will appear larger when running under Win32s or versions of Windows NT earlier than 3.51. This can cause problems if the dialog template was sized so it would fit on a screen in 640x480 resolution or if special sizing was done.
CAUSEWin32s and versions of Windows NT before 3.51 used bold fonts for dialogs. Because dialog templates are designed in dialog units, and dialog units are based on the average font size, this will cause the dialogs to be resized.
WORKAROUNDThe easiest workaround is to create two dialog templates; one sized for Windows 95 and Windows NT 3.51 or later, and one sized for Win32s and Windows NT version 3.5 or earlier. All of the controls on the two dialog templates should have the same ID so they can be used interchangeably with the same CFormView or CDialog class. The sample code below demonstrates this workaround with a default Visual C++ 4.x AppWizard-created CFormView derived class.
STATUSThis behavior is by design.
MORE INFORMATIONThe font is automatically changed to bold inside the Windows dialog manager under Win32s and Windows NT version 3.5 and it is not possible to change this behavior. Furthermore, it is not possible to specify a bold version of a font or to use the same font on all platforms because the font is specified only by its typeface name in the dialog template. It is easy to change the font inside the dialog or CFormView after it is displayed by calling CWnd::SetFont(). However, this will not resize the dialog because it is sized based on the font specified in the dialog template. While it's possible to resize the dialog in the OnInitDialog(), all of the controls will also need to be resized. This can be tedious and slow if there are a lot of controls in the dialog template. The following steps show the changes necessary to use multiple dialog templates in a Visual C++ 4.x AppWizard-created project.
Sample Code
|
KBCategory: kbprg kbtool kbprb
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |