调整MFC窗口大小 [英] Sizing an MFC Window
问题描述
我有一个MFC应用程序,该应用程序已经使用了几个星期,我想在加载时手动设置主机架的尺寸,有人可以帮忙解决一下这个问题,特别是放在哪里代码呢?
I have an MFC app which I have been working on for a few weeks now, I want to manually set the dimensions of the main frame when it is loaded, can someone give me a hand with this, specifically where to put the code as well?
谢谢!
推荐答案
您还可以在CMainFrame::OnCreate()
内或CWinApp
派生类'InitInstance
中设置大小(使用SetWindowPos()
).查找显示pMainFrame->ShowWindow()
的行,并在该行之前调用pMainFrame->SetWindowPos()
.那就是我一直在做的地方.
You can also set the size (with SetWindowPos()
) from within CMainFrame::OnCreate()
, or in the CWinApp
-derived class' InitInstance
. Look for the line that says pMainFrame->ShowWindow()
, and call pMainFrame->SetWindowPos()
before that line. That's where I always do it.
这篇关于调整MFC窗口大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!