MFC对话框大小问题 [英] MFC Dialog Size Question

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

问题描述

美好的一天。

从我的vc ++项目。 .rc文件。

from my vc++ project. .rc file.

IDD_My_DIALOG DIALOGEX 0,0,233,273
STYLE DS_SETFONT | DS_FIXEDSYS | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME
EXSTYLE WS_EX_OVERLAPPEDWINDOW | WS_EX_STATICEDGE | WS_EX_APPWINDOW
CAPTIONAMEC FA工具
FONT 8,MS Shell Dlg,0,0,0x1Q

如何更改配置一个固定的对话框,其长度= 233和高度= 273?

How to change config a fixed dialog which size to length = 233 and hight = 273 ?

任何帮助将不胜感激。

BR!
nano

BR! nano

推荐答案

这里有什么问题?对话框大小输入到DLU中,该单元用于以独立于分辨率的方式处理对话框。如果您的问题是如何在屏幕上显示总是相同大小的对话框,无论分辨率设置如何,答案是不要,但是如果您仍然必须使用GetDeviceCaps()和计算物理 - >逻辑 - >设备相关的转换。请参见 http://msdn.microsoft.com /en-us/library/bb226789%28VS.85%29.aspx ,并在本网站上搜索DLU。

What is the question here? Dialog sizes are entered in DLU's, a unit to help with dealing with dialog in a resolution-independent way. If your question is how to display a dialog that is always the same size on the screen, regardless of resolution settings, the answer is 'don't', but if you still must, you'll have to fickle with GetDeviceCaps() and calculate physical->logical->device-dependent conversions. See for example http://msdn.microsoft.com/en-us/library/bb226789%28VS.85%29.aspx and search for DLU on this site.

如果您的问题是如何制作一个对话框是高和宽的一定量的像素,无论分辨率如何,答案再次不要,但如果真的必须使用GetDialogBaseUnits()和朋友来计算OnInitDialog()中的正确大小(以像素为单位)。

If your question is how to make a dialog that is a certain amount of pixels high and wide regardless of resolution the answer is again 'don't' but if you really must, use GetDialogBaseUnits() and friends to calculate the right size (in pixels) in OnInitDialog().

如果您完全要求其他内容,请重新表述您的问题。

If you're asking for something else completely, please rephrase your question.

这篇关于MFC对话框大小问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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