找回密码
 加入
搜索
查看: 2437|回复: 7

[系统综合] 【已解决】输入框的问题

  [复制链接]
发表于 2010-12-26 16:34:33 | 显示全部楼层 |阅读模式
本帖最后由 ybbihsse 于 2010-12-27 09:20 编辑

有2个输入框,输入数据
判断输入的数据有误,清空输入框输入的内容

-------------------------------------------------------
答案详见4楼!!

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

×
发表于 2010-12-26 16:59:42 | 显示全部楼层
判断的条件是什么 ~~~
发表于 2010-12-26 17:12:24 | 显示全部楼层
GUICtrlSetData($input1,"")
GUICtrlSetData($input2,"")
试试
发表于 2010-12-26 17:55:58 | 显示全部楼层
本帖最后由 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
发表于 2010-12-26 20:32:36 | 显示全部楼层
完全不懂你的问点在哪里,如果是说怎么清空框内数据,用GUICtrlSetData函数就行

评分

参与人数 1金钱 +10 收起 理由
afan + 10

查看全部评分

发表于 2010-12-26 21:02:23 | 显示全部楼层
回复 5# 飘云

LZ的意思是如果输错用户名或者密码就清空框内数据吧.
我想LZ想知道的是怎么判断,怎么清空框内数据.
发表于 2010-12-26 21:43:00 | 显示全部楼层
     不知道你在说什么
发表于 2010-12-27 09:02:18 | 显示全部楼层
楼上给出的例子正解哈
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-6-12 01:44 , Processed in 0.077233 second(s), 22 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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