Inputquery输入框

  • 语法:function InputQuery(const ACaption, APrompt:string; var Value:string):Boolean;

    参数ACaption为对话框标题,APrompt为输入提示语,Value为值。

procedure TForm1.btn1Click(Sender: TObject);
var
  str: string;
begin
  str := InputBox('输入窗口标题', '输入提示', '默认输入内容');
  ShowMessage(str); //显示输入的内容
end;

procedure TForm1.btn2Click(Sender: TObject);
begin
   if ( InputBox('输入窗口标题', '输入提账户', '')= 'MyName' )
      and (inputbox('登录窗口','请输入密码','')='1234') then  Showmessage('欢迎进入系统')

   else begin
      Showmessage('输入有误,退出系统!');
      Application.Terminate;
   end;
end;
posted @ 2023-02-15 16:14  德琪  阅读(21)  评论(0编辑  收藏  举报