函数参考


_GUICtrlEdit_SetPasswordChar

设置或清除编辑控件的密码字符

#include <GuiEdit.au3>
_GUICtrlEdit_SetPasswordChar($hWnd [, $cDisplayChar = "0"])

参数

$hWnd 控件的控件ID/句柄
$cDisplayChar [可选参数] 用户输入字符的显示字符
如果此参数 0,则删除当前密码字符,显示用户直接输入的字符

返回值

None.

注意/说明

None.

相关

_GUICtrlEdit_GetPasswordChar

示例/演示


#include <GuiEdit.au3>
#include <GUIConstantsEx.au3>

$Debug_Ed = False ; Check ClassName being passed to Edit functions, set to True and use a handle to another control to see it work

_Main()

Func _Main()
    Local $hEdit

    ; 创建 GUI
    GUICreate("(Internal) Edit Get Password Char", 400, 300)
    $hEdit = GUICtrlCreateInput("Test of build-in control", 2, 2, 394, 25, $ES_PASSWORD)
    GUISetState()

    MsgBox(4096, "信息", "Password Char: " & _GUICtrlEdit_GetPasswordChar($hEdit))

    _GUICtrlEdit_SetPasswordChar($hEdit, "$") ; change password char to $

    MsgBox(4096, "信息", "Password Char: " & _GUICtrlEdit_GetPasswordChar($hEdit))

    _GUICtrlEdit_SetPasswordChar($hEdit) ; display characters typed by the user.

    MsgBox(4096, "信息", "Password Char: " & _GUICtrlEdit_GetPasswordChar($hEdit))

    ; 循环直到用户退出
    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE
    GUIDelete()
EndFunc   ;==>_Main