[原创] Delphi InputBoxInputQuery函数

Posted guorongtao

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了[原创] Delphi InputBoxInputQuery函数相关的知识,希望对你有一定的参考价值。

Delphi InputBox、InputQuery函数

两个函数都是弹框提示输入信息

function InputQuery(const ACaption, APrompt: string; var Value: string): Boolean;    // 输出布尔值

function InputBox(const ACaption, APrompt, ADefault: string): string;    // 输出文本

 

看一下 InputBox 的函数原型(调用了InputQuery 函数,看来它才是鼻祖):

function InputBox(const ACaption, APrompt, ADefault: string): string;
begin
 Result := ADefault;
 InputQuery(ACaption, APrompt, Result);
end;

典型应用:

Edit1.Text:= InputBox(‘窗口的标题‘, ‘提示信息‘, ‘默认值‘);

  

InputQuery函数的返回值即点击了OK返回True,否则返回False

 

更新日期:2019.12.18

来源于:https://www.cnblogs.com/guorongtao/p/12061027.html

以上是关于[原创] Delphi InputBoxInputQuery函数的主要内容,如果未能解决你的问题,请参考以下文章