Board index » delphi » How can you mask an input box?

How can you mask an input box?

sorry and thanks.

"Rudy Velthuis (TeamB)" <rvelth...@gmx.de> wrote in message
news:MPG.18d56e292e112f5e98a837@forums.borland.com...

Quote
> In article <3e6b4...@newsgroups.borland.com>, Gadi says...

> > Hello All.

> > how can i make an input box masked so that when you type a character it
> > turns into a "*"

> Gadi, you posted this to the .basm (built-in assembler) group as well as
> to the .objectpascal group. Not only is that a multi-post, which is not
> allowed, but both groups are wrong as well.

> Please, next time, only post to the one most appropriate group. In this
> case it would be borland.public.delphi.vcl.components.using. Followup to
> that group was set (i.e. a reply to this message will go there).

> But now back to your question: I don't think there is a way to specify
> this for the InputBox routines. But you can easily create a little
> dialog with a TEdit that has the right properties set, and otherwise
> behaves like the InputBox dialog. It's just a little more work.
> --
> Rudy Velthuis (TeamB)

> "Put your hand on a hot stove for a minute, and it seems like an hour.
>  Sit with a pretty girl for an hour, and it seems like a minute.
>  THAT'S relativity." - Albert Einstein

 

Re:How can you mask an input box?


In article <3e6b4...@newsgroups.borland.com>, Gadi says...

Quote
> Hello All.

> how can i make an input box masked so that when you type a character it
> turns into a "*"

Gadi, you posted this to the .basm (built-in assembler) group as well as
to the .objectpascal group. Not only is that a multi-post, which is not
allowed, but both groups are wrong as well.

Please, next time, only post to the one most appropriate group. In this
case it would be borland.public.delphi.vcl.components.using. Followup to
that group was set (i.e. a reply to this message will go there).

But now back to your question: I don't think there is a way to specify
this for the InputBox routines. But you can easily create a little
dialog with a TEdit that has the right properties set, and otherwise
behaves like the InputBox dialog. It's just a little more work.
--
Rudy Velthuis (TeamB)

"Put your hand on a hot stove for a minute, and it seems like an hour.
 Sit with a pretty girl for an hour, and it seems like a minute.
 THAT'S relativity." - Albert Einstein

Re:How can you mask an input box?


In article <3e6b514...@newsgroups.borland.com>, Gadi says...

Quote
> sorry and thanks.

Please also read the message in the other group about overquoting. <g>
--
Rudy Velthuis (TeamB)

"Put your hand on a hot stove for a minute, and it seems like an hour.
 Sit with a pretty girl for an hour, and it seems like a minute.
 THAT'S relativity." - Albert Einstein

Re:How can you mask an input box?


....

procedure TForm1.pmInputQuery(var Msg: TMessage); //message WM_USER
+123;
var
  frm : TForm;
  ed : TEdit;
  i : integer;
begin
  frm := Screen.ActiveForm;
  if frm.Caption = InputCap then begin
    i := 0;
    ed := nil;
    while (i < frm.ComponentCount) and (ed = nil) do begin
      if frm.Components[i] is TEdit then
        ed := TEdit(frm.Components[i]);
      Inc(i);
    end;

    if ed <> nil then
      SendMessage( ed.Handle, EM_SETPASSWORDCHAR, ord('*'), 0 );
  end;
end;

procedure TForm1.Button1Click(Sender: TObject);
var
  s : string;
begin
  s := 'testing';
  InputCap := 'Test query?';
  PostMessage(Handle, WM_USER +123, 0, 0);

  if InputQuery( InputCap, 'Prompt', s ) then
    showmessage(s);
end;

Quote
"Rudy Velthuis (TeamB)" wrote:

> In article <3e6b4...@newsgroups.borland.com>, Gadi says...

> > Hello All.

> > how can i make an input box masked so that when you type a character it
> > turns into a "*"

> But now back to your question: I don't think there is a way to specify
> this for the InputBox routines. But you can easily create a little
> dialog with a TEdit that has the right properties set, and otherwise
> behaves like the InputBox dialog. It's just a little more work.
> --
> Rudy Velthuis (TeamB)

> "Put your hand on a hot stove for a minute, and it seems like an hour.
>  Sit with a pretty girl for an hour, and it seems like a minute.
>  THAT'S relativity." - Albert Einstein

Other Threads