【已解决】输入框的问题
本帖最后由 ybbihsse 于 2010-12-27 09:20 编辑有2个输入框,输入数据
判断输入的数据有误,清空输入框输入的内容
-------------------------------------------------------
答案详见4楼!! 判断的条件是什么 ~~~ GUICtrlSetData($input1,"")
GUICtrlSetData($input2,"")
试试 本帖最后由 lixiaolong 于 2010-12-26 18:06 编辑
回复 1# ybbihsse
一个例子:
#include <GUIConstantsEx.au3>
GUICreate(" GUI 接收文件的输入控件", 320, 120)
$yonghu = GUICtrlCreateInput("", 60, 5, 240, 20)
GUICtrlCreateLabel("用户名:", 10, 10)
$mima = GUICtrlCreateInput("", 60, 35, 240, 20)
GUICtrlCreateLabel("密码:", 10, 35)
$btn = GUICtrlCreateButton("确定", 240, 75, 60, 20)
GUICtrlSetState($btn, $GUI_DEFBUTTON)
$yonghuming = "lixiaolong"
$pass = "pass"
GUISetState()
While 1
$msg = GUIGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
Exit
Case $msg = $btn
If GUICtrlRead($yonghu) == $yonghuming And GUICtrlRead($mima) == $pass Then
MsgBox(0, "", "您输对了!")
Else
MsgBox(0, "", "您输入的用户名或者密码不对!请输入正确的用户名或者密码!")
GUICtrlSetData($yonghu, "")
GUICtrlSetData($mima, "")
EndIf
EndSelect
WEnd
隐藏密码:
#include <GUIConstantsEx.au3>
#include <EditConstants.au3>
GUICreate(" GUI 接收文件的输入控件", 320, 120)
$yonghu = GUICtrlCreateInput("", 60, 5, 240, 20)
GUICtrlCreateLabel("用户名:", 10, 10)
$mima = GUICtrlCreateInput("", 60, 35, 240, 20, $ES_PASSWORD)
GUICtrlCreateLabel("密码:", 10, 40)
$btn = GUICtrlCreateButton("确定", 240, 75, 60, 20)
GUICtrlSetState($btn, $GUI_DEFBUTTON)
$yonghuming = "lixiaolong"
$pass = "pass"
GUISetState()
While 1
$msg = GUIGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
Exit
Case $msg = $btn
If GUICtrlRead($yonghu) == $yonghuming And GUICtrlRead($mima) == $pass Then
MsgBox(0, "", "您输对了!")
Else
MsgBox(0, "", "您输入的用户名或者密码不对!请输入正确的用户名或者密码!")
GUICtrlSetData($yonghu, "")
GUICtrlSetData($mima, "")
EndIf
EndSelect
WEnd 完全不懂你的问点在哪里,如果是说怎么清空框内数据,用GUICtrlSetData函数就行 回复 5# 飘云
LZ的意思是如果输错用户名或者密码就清空框内数据吧.
我想LZ想知道的是怎么判断,怎么清空框内数据. {:face (332):} 不知道你在说什么 楼上给出的例子正解哈
页:
[1]