Dialog MFC资源度量的单位是什么 [英] What are the units for Dialog MFC Resource Measurements

查看:110
本文介绍了Dialog MFC资源度量的单位是什么的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在此声明语法中,来自 https://msdn.microsoft.com/zh-CN/library/windows/desktop/aa381003(v = vs.85).aspx

In this declaration syntax from https://msdn.microsoft.com/en-us/library/windows/desktop/aa381003(v=vs.85).aspx

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

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

what are the units used for width and height?

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

I assumed that they were pixels, and so set my window to 640x480. However, I now have a window that is too big for my needs.

推荐答案

单位是对话框单元,如

The units are dialog units as explained in the DIALOGEX resource definition statement. The DIALOG is deprecated. Excerpt:

x
对话框左侧屏幕上的位置,以对话框单位.

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

y
对话框顶部屏幕上的位置,以对话框单位.

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

要检索基于对话框的单元,请使用此技术.

To retrieve the dialog based units use the GetDialogBaseUnits function. As per xMRi's suggestion, for a non system font use this technique.

这篇关于Dialog MFC资源度量的单位是什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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