Settings | Sign in | Sign up

The author has 6 posts.

RC资源中,按钮的默认尺寸:50DU x 14DU, DU=对话框单位

Floor 1 巨大八爪鱼 9/24/16 23:39
IDD_DIALOG1 DIALOGEX 0, 0, 309, 177
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Dialog"
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
    DEFPUSHBUTTON   "OK",IDOK,198,156,50,14
    PUSHBUTTON      "Cancel",IDCANCEL,252,156,50,14
    CONTROL         "Check1",IDC_CHECK1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,7,295,163
    PUSHBUTTON      "Button1",IDC_BUTTON1,7,7,295,163
END
Floor 2 巨大八爪鱼 9/24/16 23:44
VS2012默认对话框大小:309DU x 177DU
对话框中的虚线框:位置: (7DU, 7DU),尺寸295DU x 163DU
因此对话框的默认边界为7DU。
因为2x7+295=309,2x7+163=177。
Floor 3 巨大八爪鱼 9/24/16 23:45
DU (Device Unit) 是与字体大小有关的长度单位。
Floor 4 巨大八爪鱼 9/24/16 23:51
DBU-- 对话框的基本单位:http://shortof.com/suoxie/Dialog-Base-Units-DBU
Floor 5 巨大八爪鱼 9/24/16 23:59
右下角“取消”按钮坐标的计算:
x坐标:252=309-7-50
y坐标:156=177-7-14
Floor 6 巨大八爪鱼 9/25/16 10:34
Font语句的格式:
https://msdn.microsoft.com/en-us/library/windows/desktop/aa381013(v=vs.85).aspx

Content converter:

Reply the post
Content:
User: You are currently anonymous.
Captcha:
Unclear? Try another one.