Code: Select all
#NoEnv
#SingleInstance Force
M := 10
Gui, Margin, %M%, %M%
Gui, Font, s16
Gui, Add, Edit, Password vEdit1 w200, Hello world
Gui, Add, Checkbox, -Checked vCheckbox1 gShow wp, Show password
Gui, Show
Return
Show()
{
Global
Gui, Submit, NoHide
If Checkbox1
GuiControl, -Password, Edit1
Else
GuiControl, +Password, Edit1
;GuiControl, +Password●, Edit1 ;Problem 1: Default bullet character not used unless explicitly specified
GuiControl,, Edit1, %Edit1% ;Problem 2: control not updated unless manually re-written or mouse pointer passes over it
}
1) Enabling/disabling the Password option doesn't immediately update the Edit box control. The control is not refreshed until the mouse is positioned over it. This can be remedied by re-writing something to the Edit control, as in this example.
2) The password mask character, which by default is a black circle or "bullet", becomes an asterisk once the Password option is manipulated by means of the GuiControl command. Check and uncheck the checkbox to see what happens to the Edit1 control. The workaround is to explicitly force the bullet character.
Thanks!