调整MFC窗口大小 [英] Sizing an MFC Window

查看:70
本文介绍了调整MFC窗口大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆