找回密码
 加入
搜索
查看: 1645|回复: 3

[AU3基础] 如何知道input控件中某个键被按下(已解决)

[复制链接]
发表于 2014-5-18 11:29:44 | 显示全部楼层 |阅读模式
本帖最后由 welsn 于 2014-5-18 12:14 编辑

请问:input控件中输入一串字符后按下ENTER键,请问如何判断这个ENTER被按下了(是在input输入中按下的,而不是在其他情况下按下)
发表于 2014-5-18 11:54:12 | 显示全部楼层
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 287, 155, 192, 124)
$Input1 = GUICtrlCreateInput("", 40, 32, 201, 21)
$Button1 = GUICtrlCreateButton("ok", 96, 88, 81, 33)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit
                Case $Input1 ;要改变内容再按下
                        MsgBox(64,"提示","你按下了回车键")
        EndSwitch
WEnd
 楼主| 发表于 2014-5-18 12:04:54 | 显示全部楼层
感谢居士.....
发表于 2014-5-19 16:16:56 | 显示全部楼层
感谢,噶写,学习了,顺便露个脸
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-9-28 05:19 , Processed in 0.081254 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表