找回密码
 加入
搜索
查看: 4839|回复: 8

[AU3基础] 请问input框输入的内容如何以"星号"显示(已解决)

  [复制链接]
发表于 2010-8-13 11:16:30 | 显示全部楼层 |阅读模式
本帖最后由 faceyao 于 2010-8-14 11:12 编辑

也就是把Label框作为输入密码的框,要求输入的内容以星号显示。普通的Label框输入的内容是看得见的。

另外有没有koda的中文教材或教程,万分感谢!

评分

参与人数 1金钱 +10 收起 理由
afan + 10 感谢主动将修改帖子分类为[已解决],请继续 ...

查看全部评分

发表于 2010-8-13 11:17:13 | 显示全部楼层
Label框???
发表于 2010-8-13 11:19:17 | 显示全部楼层
你说的是Edit/input框吧....
定义一个$ES_PASSWORD样式

评分

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

查看全部评分

 楼主| 发表于 2010-8-14 10:37:33 | 显示全部楼层
回复 2# afan

是的,是label框
 楼主| 发表于 2010-8-14 10:39:15 | 显示全部楼层
#include <ButtonConstants.au3>

#include <EditConstants.au3>

#include <GUIConstantsEx.au3>

#include <StaticConstants.au3>

#include <WindowsConstants.au3>



$Form1 = GUICreate("同学毕业照片集", 483, 316, 296, 221)

$Pic1 = GUICtrlCreatePic("C:\Users\CEAO\Desktop\Hasnne.jpg", 0, 0, 481, 129, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))

$Label1 = GUICtrlCreateInput("", 120, 168, 185, 21)

GUICtrlCreateLabel("用户名:", 48, 168, 72, 24)

GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif")

GUICtrlCreateLabel("密码:", 48, 200, 55, 24)

GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif")

$Label2 = GUICtrlCreateInput("", 124, 198, 177, 21)

GUICtrlSetBkColor(-1, 0x3399FF)

$Button1 = GUICtrlCreateButton("登录", 152, 248, 121, 41)

GUICtrlSetFont(-1, 16, 400, 0, "宋体")

GUISetState(@SW_SHOW)





While 1

        $nMsg = GUIGetMsg()

        Switch $nMsg

                        Case $GUI_EVENT_CLOSE

                                Exit



                        Case $Button1

                                If GUICtrlRead($Label1) == 'abc' And GUICtrlRead($Label2) == '123' Then MsgBox(0 ,"ok" ,"")

                                

                

                        

        EndSwitch

WEnd
如上代码,需要是label框的输入以“星号”显示,请问代码该怎么写,谢谢
发表于 2010-8-14 10:43:48 | 显示全部楼层
$Label2 = GUICtrlCreateInput("", 124, 198, 177, 21,$ES_PASSWORD)


明明是个input你非说是label干嘛.....
加上那个样式就可以了
发表于 2010-8-14 10:53:11 | 显示全部楼层
回复 5# faceyao


    。。。你不会不知道控件样式怎么加的吧?
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>



$Form1 = GUICreate("同学毕业照片集", 483, 316, 296, 221)
$Pic1 = GUICtrlCreatePic("C:\Users\CEAO\Desktop\Hasnne.jpg", 0, 0, 481, 129, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
$Label1 = GUICtrlCreateInput("", 120, 168, 185, 21)
GUICtrlCreateLabel("用户名:", 48, 168, 72, 24)
GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif")
GUICtrlCreateLabel("密码:", 48, 200, 55, 24)
GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif")
$Label2 = GUICtrlCreateInput("", 124, 198, 177, 21,$ES_PASSWORD)
GUICtrlSetBkColor(-1, 0x3399FF)
$Button1 = GUICtrlCreateButton("登录", 152, 248, 121, 41)
GUICtrlSetFont(-1, 16, 400, 0, "宋体")
GUISetState(@SW_SHOW)


While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                        Case $GUI_EVENT_CLOSE
                                Exit
                        Case $Button1
                                If GUICtrlRead($Label1) == 'abc' And GUICtrlRead($Label2) == '123' Then MsgBox(0 ,"ok" ,"")
        EndSwitch
WEnd

评分

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

查看全部评分

 楼主| 发表于 2010-8-14 11:11:08 | 显示全部楼层
明明是个input你非说是label干嘛.....
加上那个样式就可以了
Ziya 发表于 2010-8-14 10:43



这个的确是我弄错了,看错了,的确是input框而不是标签
 楼主| 发表于 2010-8-14 11:11:36 | 显示全部楼层
回复 7# xsjtxy

谢谢7楼的,已解决!
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-5-17 16:24 , Processed in 0.098770 second(s), 30 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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