How To Center a Dialog Using the Microsoft Foundation Classes (102328)
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
- Microsoft Visual C++ .NET (2002)
- Microsoft Visual C++ .NET (2003)
This article was previously published under Q102328 NOTE: Microsoft Visual C++ NET (2002) supported both the managed code
model that is provided by the .NET Framework and the unmanaged native Windows
code model. The information in this article applies to unmanaged Visual C++
code only. SUMMARY In an application developed with the Microsoft Foundation
Classes library, you may want to automatically center a dialog box with respect
to its parent window when it is created.
To do this, it is necessary
to ensure that the dialog box can be centered without regard to its parent
window (to support the case in which the caller specified NULL as the parent
window handle). You must add additional code to center the dialog box with
respect to the desktop window when no parent is specified and with respect to
the parent window otherwise.
Modification Type: | Minor | Last Reviewed: | 6/29/2004 |
---|
Keywords: | kbDlg kbhowto KbUIDesign KB102328 |
---|
|