如何在 MFC SDI CFormView 应用程序中调整表单(对话框)的大小?

问题描述:

我试过了MoveWindow(50,50,150,200,TRUE) in CMyFormView::OnInitialUpdate();

另外,我在

CWinApp::InitInstance();
RECT desktop;

const HWND hDesktop = ::GetDesktopWindow();
::GetWindowRect(hDesktop,&desktop);

MoveWindow(hDesktop,0,0,900,400,TRUE);  

我无法调整表单(对话框)的大小.
我将不胜感激任何建议.

I am having no luck resizing the form(dialog).
I would appreciate any suggestions.

在 SDI 程序中,对话框的大小由主机窗口调整以填充客户区.调整框架窗口的大小,随后会出现对话框.把这个放在表单视图的 OnInitialUpdate

In an SDI program the dialog is sized by the mainframe window to fill the client area. Resize the frame window and the dialog will follow. Put this in the formview's OnInitialUpdate

AfxGetMainWnd()->MoveWindow(....);