Inputbox:
answer:=Inputbox('a','b','c');
works good, but I'm looking for a masked one, like a password box where you only see little stars instead of the typed characters.
Inputbox:
answer:=Inputbox('a','b','c');
works good, but I'm looking for a masked one, like a password box where you only see little stars instead of the typed characters.
In XE2,
InputBox()
andInputQuery()
were updated to natively support masking theTEdit
input, although that feature has not been documented yet. If the first character of theAPrompt
parameter is set to any value <#32
then theTEdit.PasswordChar
will be set to*
, eg:I don't think that Delphi includes such a thing out of the box. Maybe you can find one at http://www.torry.net/ or elsewhere in the net. Otherwise just write one yourself - shouldn't be that hard. :-) You can even look at the source code if you have a "big enough" Delphi version.
Uli.
You can use InputQuery instead of InputBox. When the TRUE argument is set, password field will be masked.
Some resource here; http://lazarus-ccr.sourceforge.net/docs/lcl/dialogs/inputquery.html
You can send a Windows message to the edit control created by
InputBox
, that will flag the edit control for password entry. Code below taken from http://www.swissdelphicenter.ch/en/showcode.php?id=1208:InputBox calls the InputQuery function in Dialogs, which creates the form dynamically. You could always make a copy of this function and change the TEdit's PasswordChar property.