Menu

Masked TEdit derived control to get password input

2018-02-11
2018-02-12
  • Gianni Rossi

    Gianni Rossi - 2018-02-11

    Hello,

    I have a Borland C++ 5.02 OWL application (so not OWLNext) in which I need to request the user password and obviously I would like to implement a usual masked input visualizing dots instead of the real typed characters.

    So I wonder if someone of you has already implemented a TEdit derived class for this purpose and is willing to send it to me.

    Thanks in advance.
    Gianni Rossi

     
  • Sebastian Ledesma

    Hi Gianni:

    The standard windows EDIT control (aka TEdit for OWL/OWLnext) already has the 'password' attribute. Just use the Resource Workshop to enable the 'password' atribute.

    Best regards,
    Sebastian

     
    • Gianni Rossi

      Gianni Rossi - 2018-02-11

      Hi Sebastian,

      Thanks for your reply.

      Sorry I did not well specify my purpose.

      I would like to show dots instead of asterisks and also allow only a certain
      set of characters.

      Ciao,

      Gianni Rossi


      Moderator: Removed quoted content.

       

      Last edit: Vidar Hasfjord 2018-02-12
  • Sebastian Ledesma

    1 - I dont know of any implementation of 'TPasswordEdit' that allows to select the visible char.
    2 - You can use a TValidator to allow specific chars. in your TEdit.

    Saludos
    Sebas

     
  • Ognyan Chernokozhev

    Hi, Gianni,

    You can try to use TEdit::SetPasswordChar() to change the displayed character in a password edit box. Behind the scenes it sends a EM_SETPASSWORDCHAR message to the control.

    Jogy

     
    • Gianni Rossi

      Gianni Rossi - 2018-02-12

      Hi Sebastian, Ognian and Jogy,

      Thanks for your help, I'll try what you suggested and let you know.

      Ciao.

      Gianni Rossi
      Tecnobit S.r.l.
      Via B. Sacchi, 9
      36061 Bassano del Grappa (VI)
      Italy

       

      Last edit: Gianni Rossi 2018-02-12

Anonymous
Anonymous

Add attachments
Cancel