Jump to content

Recommended Posts

Posted

ok i know how to hide the letters typed into the input with $ES_PASSWORD but how would i have the input say (Enter Password) then when i click it it deletes that and then i type my password and it hides it with password dots But if i dont type anything and click out of the password input box it will come up with (Enter Password)

Posted

so something like this? but its not working

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form2 = GUICreate("Password Dialog", 251, 96, -1, -1)
$Input1 = GUICtrlCreateInput("Enter Password", 8, 32, 233, 21)
$PasswordEdit = GUICtrlCreateInput("password", 8, 32, 233, 21, BitOR($ES_PASSWORD,$ES_AUTOHSCROLL))
GUICtrlSetState($PasswordEdit, $GUI_HIDE)
$ButtonOk = GUICtrlCreateButton("&OK", 86, 64, 75, 25, 0)
$ButtonCancel = GUICtrlCreateButton("&Cancel", 167, 64, 75, 25, 0)
$EnterPassLabel = GUICtrlCreateLabel("Enter password", 8, 12, 77, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Input1
            GUICtrlSetState($Input1, $GUI_HIDE)
            GUICtrlSetState($PasswordEdit, $GUI_SHOW)
    EndSwitch
WEnd
Posted

No, don't you reminder my original solution? It should be on click. When you click an input box, it gets focus, what do you to check focus? Right, ControlGetFocus.

I'm going to hate myself for giving you this but I don't want to go through another 20 page discussion. Why did I even reply to this topic?

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form2 = GUICreate("Password Dialog", 251, 96, -1, -1)
$Input1 = GUICtrlCreateInput("Enter Password", 8, 32, 233, 21)
$PasswordEdit = GUICtrlCreateInput("", 8, 32, 233, 21, BitOR($ES_PASSWORD,$ES_AUTOHSCROLL))
GUICtrlSetState($PasswordEdit, $GUI_HIDE)
GUICtrlSetState($PasswordEdit, $GUI_FOCUS)
$ButtonOk = GUICtrlCreateButton("&OK", 86, 64, 75, 25, 0)
$ButtonCancel = GUICtrlCreateButton("&Cancel", 167, 64, 75, 25, 0)
$EnterPassLabel = GUICtrlCreateLabel("Enter password", 8, 12, 77, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Input1
            GUICtrlSetState($Input1, $GUI_HIDE)
            GUICtrlSetState($PasswordEdit, $GUI_SHOW)
        EndSwitch
        
    If ControlGetFocus($Form2) == "Edit1" Then
        GUICtrlSetState($Input1, $GUI_HIDE)
        GUICtrlSetState($PasswordEdit, $GUI_SHOW)
        GUICtrlSetState($PasswordEdit, $GUI_FOCUS)
    EndIf
WEnd

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...