问题描述
我已经创建了带有编辑控件的对话框,但是当我单击编辑控件区域"对话框时,该对话框会关闭吗?
如何在编辑控件中打印值以及如何从编辑控件中获取值?
这是我的对话框
IDD_ADDRULEDLG DIALOGEX 0、0、308、213
样式DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
标题添加规则"
字体8,"MS Sans Serif",0,0,0x0
开始
DEFPUSHBUTTON添加",IDOK,87,179,50,14
PUSHBUTTON取消",IDCANCEL,152,179,50,14
LTEXT"Action",IDC_STATIC,150,153,25,11
GROUPBOX来源",IDC_STATIC,22,14,262,62
LTEXT"IP地址",IDC_STATIC,43,28,42,8
GROUPBOX目标",IDC_STATIC,23,80,262,62
LTEXT"IP地址",IDC_STATIC,44,95,42,10
LTEXT(0.0.0.0 pfor all)",IDC_STATIC,35,104,50,8
LTEXT"IP掩码",IDC_STATIC,45,57,42,10
LTEXT(0.0.0.0 for all)",IDC_STATIC,39,37,46,8
LTEXT(共0个)",IDC_STATIC,199,37,30,8
LTEXT"Port",IDC_STATIC,205,30,14,8
LTEXT"Port",IDC_STATIC,205,98,14,8
LTEXT(共0个)",IDC_STATIC,200,105,30,8
LTEXT"IP掩码",IDC_STATIC,46,122,42,10
LTEXT"Protocol",IDC_STATIC,42,153,27,8
COMBOBOX IDC_COMBO4,81,151,44,49,CBS_DROPDOWNLIST | CBS_OWNERDRAWVARIABLE | WS_VSCROLL | WS_TABSTOP
COMBOBOX IDC_COMBO3,182,151,70,51,CBS_DROPDOWNLIST | CBS_OWNERDRAWVARIABLE | CBS_SORT | WS_VSCROLL | WS_TABSTOP
EDITTEXT IDC_EDIT2,237,30,30,12,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER
EDITTEXT IDC_EDIT1,95,30,69,12,ES_RIGHT | ES_AUTOHSCROLL
EDITTEXT IDC_EDIT6,95,55,69,12,ES_RIGHT | ES_AUTOHSCROLL
EDITTEXT IDC_EDIT3,95,97,69,12,ES_RIGHT | ES_AUTOHSCROLL
EDITTEXT IDC_EDIT5,95,121,69,12,ES_RIGHT | ES_AUTOHSCROLL
EDITTEXT IDC_EDIT4,237,97,30,12,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER
END
这是我的对话框
I have created dialog box with edit control but when i click on edit control area dialog box get close?
How to print value in edit control and how to get value from edit control?
This is my dialog box
IDD_ADDRULEDLG DIALOGEX 0, 0, 308, 213
STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Add a Rule"
FONT 8, "MS Sans Serif", 0, 0, 0x0
BEGIN
DEFPUSHBUTTON "Add",IDOK,87,179,50,14
PUSHBUTTON "Cancel",IDCANCEL,152,179,50,14
LTEXT "Action",IDC_STATIC,150,153,25,11
GROUPBOX "Source",IDC_STATIC,22,14,262,62
LTEXT "IP Address",IDC_STATIC,43,28,42,8
GROUPBOX "Destination",IDC_STATIC,23,80,262,62
LTEXT "IP Address",IDC_STATIC,44,95,42,10
LTEXT "(0.0.0.0 pfor all)",IDC_STATIC,35,104,50,8
LTEXT "IP Mask",IDC_STATIC,45,57,42,10
LTEXT "(0.0.0.0 for all)",IDC_STATIC,39,37,46,8
LTEXT "(0 for all)",IDC_STATIC,199,37,30,8
LTEXT "Port",IDC_STATIC,205,30,14,8
LTEXT "Port",IDC_STATIC,205,98,14,8
LTEXT "(0 for all)",IDC_STATIC,200,105,30,8
LTEXT "IP Mask",IDC_STATIC,46,122,42,10
LTEXT "Protocol",IDC_STATIC,42,153,27,8
COMBOBOX IDC_COMBO4,81,151,44,49,CBS_DROPDOWNLIST | CBS_OWNERDRAWVARIABLE | WS_VSCROLL | WS_TABSTOP
COMBOBOX IDC_COMBO3,182,151,70,51,CBS_DROPDOWNLIST | CBS_OWNERDRAWVARIABLE | CBS_SORT | WS_VSCROLL | WS_TABSTOP
EDITTEXT IDC_EDIT2,237,30,30,12,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER
EDITTEXT IDC_EDIT1,95,30,69,12,ES_RIGHT | ES_AUTOHSCROLL
EDITTEXT IDC_EDIT6,95,55,69,12,ES_RIGHT | ES_AUTOHSCROLL
EDITTEXT IDC_EDIT3,95,97,69,12,ES_RIGHT | ES_AUTOHSCROLL
EDITTEXT IDC_EDIT5,95,121,69,12,ES_RIGHT | ES_AUTOHSCROLL
EDITTEXT IDC_EDIT4,237,97,30,12,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER
END
This is my dialog box
这篇关于编辑控制有问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!