c++ - Dialog MFC 资源测量的单位是什么

标签 c++ visual-studio-2010 mfc dialog

此声明语法来自 https://msdn.microsoft.com/en-us/library/windows/desktop/aa381003(v=vs.85).aspx

nameID DIALOG x, y, width, height  [optional-statements] {control-statement  . . . }

宽度和高度的单位是什么?

我假设它们是像素,因此将我的窗口设置为 640x480。但是,我现在的窗口太大了,无法满足我的需求。

最佳答案

单位是对话单位,如 DIALOGEX 中所述。资源定义语句。 DIALOG 已弃用。摘录:

x
Location on the screen of the left side of the dialog box, in dialog units.

y
Location on the screen of the top of the dialog box, in dialog units.

要检索基于对话框的单位,请使用 GetDialogBaseUnits 功能。根据 xMRi 的建议,对于非系统字体,请使用 this technique .

关于c++ - Dialog MFC 资源测量的单位是什么,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45297886/

相关文章:

c++ - 在一个范围内推送五个对象指针,然后检查对象的 bool 是否为 false,会出错

c# - 无需安装 .NET 框架即可创建独立的 exe

visual-studio-2010 - 自定义操作系统上的 STL - std::list 有效,但 std::vector 无效

c# - 在静态方法的 Intellisense 中显示 XML 注释通用参数

c++ - 放弃 CMainFrame 中的 ALT 按键操作

c++ - MFC BitBlt 和 SetDIBits 与 SetBitmapBits

c++ - 创建一个像工作区一样的油漆并能够移动它们

c++ - 以编程方式获取 GPU 内存使用情况

c++ - Boost.Log 无法设置日志过滤器(未声明的标识符 'severity')

c++ - 使用 const 进行函数重载