关于实时更新控件显示[已解决]
本帖最后由 heroxianf 于 2016-6-12 10:31 编辑看到很多示例,伴随着输入对应结果显示就输出了结果。请问这个方法是如何实现的? 把根据输入得出结果的代码写到循环中
没看见你的代码,你自己参考修改吧:
While 1
$nMsg = GUIGetMsg(1)
GUICtrlSetData($Edit21, GUICtrlRead($Input21) & GUICtrlRead($Input24) & GUICtrlRead($Input23) & @CRLF & "......" & _
@CRLF & GUICtrlRead($Input21) & GUICtrlRead($Input25) & GUICtrlRead($Input23))
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $gu_Button
;
Case $gu_Button
;
EndSwitch
WEnd
回复 2# hnfeng
谢谢,例子中代码太长了,不晓得分离拿部门。 #include <GuiEdit.au3>
#include <WinAPI.au3> ; used for Lo/Hi word
#include <WindowsConstants.au3>
#include <GUIConstantsEx.au3>
$hGUI = GUICreate("Edit Create", 400, 280)
$hEdit = _GUICtrlEdit_Create($hGUI, "请输入数据", 2, 2, 394, 128)
$hEdit2 = _GUICtrlEdit_Create($hGUI, "", 2, 142, 394, 128, BitOR($ES_READONLY,$ES_MULTILINE))
GUISetState()
GUIRegisterMsg($WM_COMMAND, "WM_COMMAND")
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
GUIDelete()
Func WM_COMMAND($hWnd, $iMsg, $iwParam, $ilParam)
#forceref $hWnd, $iMsg
Local $hWndFrom, $iIDFrom, $iCode, $hWndEdit
If Not IsHWnd($hEdit) Then $hWndEdit = GUICtrlGetHandle($hEdit)
$hWndFrom = $ilParam
$iIDFrom = _WinAPI_LoWord($iwParam)
$iCode = _WinAPI_HiWord($iwParam)
Switch $hWndFrom
Case $hEdit, $hWndEdit
Switch $iCode
Case $EN_CHANGE
_GUICtrlEdit_SetText($hEdit2, '您输入了以下数据:' &@CRLF & _GUICtrlEdit_GetText($hEdit))
EndSwitch
EndSwitch
Return $GUI_RUNDEFMSG
EndFunc
{:face (125):} 谢谢两位,问题解决了~ 经验啊... 向楼主学习
http://www.discuz.net/static/image/common/sigline.gif
古龙大红八角 古龙八角 大红八角
页:
[1]