请问input框输入的内容如何以"星号"显示(已解决)
本帖最后由 faceyao 于 2010-8-14 11:12 编辑也就是把Label框作为输入密码的框,要求输入的内容以星号显示。普通的Label框输入的内容是看得见的。
另外有没有koda的中文教材或教程,万分感谢! Label框??? 你说的是Edit/input框吧....
定义一个$ES_PASSWORD样式 回复 2# afan
是的,是label框 #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框的输入以“星号”显示,请问代码该怎么写,谢谢 $Label2 = GUICtrlCreateInput("", 124, 198, 177, 21,$ES_PASSWORD)
明明是个input你非说是label干嘛.....
加上那个样式就可以了 回复 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
明明是个input你非说是label干嘛.....
加上那个样式就可以了
Ziya 发表于 2010-8-14 10:43 http://www.autoitx.com/images/common/back.gif
这个的确是我弄错了,看错了,的确是input框而不是标签 回复 7# xsjtxy
谢谢7楼的,已解决!
页:
[1]