如何在MFC中创建可调整大小的CDialog? [英] How to create a resizable CDialog in MFC?

查看:135
本文介绍了如何在MFC中创建可调整大小的CDialog?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须创建一个基于对话框的应用程序,而不是旧的CFormView类型的设计.但是CDialog会生成固定大小的对话框.如何创建具有可调整大小对话框的基于对话框的应用程序?

I have to create a dialog based application, instead of old CFormView type of design. But CDialog produces fixed-size dialogs. How can I create dialog based applications with resizable dialogs?

推荐答案

在RC资源文件中,如果对话框具有与此类似的样式,则它将是固定大小:

In the RC resource file if the dialog has this style similar to this it will be fixed size:

IDD_DIALOG_DIALOG DIALOGEX 0, 0, 320, 201
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU

如果对话框具有这种样式,它将是相当大的:

If the dialog has this style it will be sizeable:

IDD_DIALOG_DIALOG DIALOGEX 0, 0, 320, 201
STYLE WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME

使用这些可调整的框架选项,对话框将可调整大小,但是您仍然需要做很多工作来处理 WM_SIZE 消息,以管理对话框中控件的大小.

With these sizable frame options the dialog will be re-sizeable but you will still need to do a lot of work handling the WM_SIZE message to manage the sizing an positioning of the controls within the dialog.

这篇关于如何在MFC中创建可调整大小的CDialog?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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