找回密码
 加入
搜索
查看: 1044|回复: 2

请教关于是Edit文本框的问题

[复制链接]
发表于 2009-5-12 12:11:26 | 显示全部楼层 |阅读模式
本帖最后由 zjg2003 于 2009-5-13 21:20 编辑

默认设置了 Edit文本框 里面有数据,现在就是想:

当鼠标点击 Edit文本框 时自动清空里面的数据

不知道要如何判断鼠标点击是否点击了 Edit文本框?
发表于 2009-5-12 16:12:06 | 显示全部楼层
1# zjg2003
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 633, 447, 192, 124)
$Edit1 = GUICtrlCreateEdit("", 80, 40, 449, 273)
GUICtrlSetData(-1, "在这里输入文本")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
        $nMsg = GUIGetMsg()
        $Mouse=GUIGetCursorInfo()
        If $Mouse[2]=1 And $Mouse[4]=$Edit1 Then
                $Txt=GUICtrlRead($Edit1)
                If $Txt="在这里输入文本" Then
                        GUICtrlSetData($Edit1,"")
                EndIf
        EndIf
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit

        EndSwitch
WEnd
 楼主| 发表于 2009-5-13 21:20:09 | 显示全部楼层
谢谢,照你说的OK了
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-5-7 16:01 , Processed in 0.071460 second(s), 19 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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