Delphi中Inputbox 和Inputquery 函数的使用
来源:互联网 发布:windows工业版 编辑:程序博客网 时间:2024/06/12 16:03
inputbox的返回值是,你在输入框中输入的文字。而inputquery的返回值是,你是否点击了确定按钮。它的返回值是布尔型的。如果你在inputbox中一样也不输入,就点击取消的话,就会提示出错,而inputquery就不会。它们前面的两个参数都是一样的,分别是输入框的标题,和提示信息。例:
if inputbox('加法题','7+5','')='12' then
showmessage('yes')
else
showmessage('no')
点取消和不等于该函数的第三个参数都返回false;
var
inputtext:string;
if InputQuery('信息','请输入口令',inputtext)=true then
begin
InputBox 是调用了 InputQuery, InputQuery 是通过一个 var 参数获取新字串:
InputQuery 可返回一个 Boolean 值, 可判断用户是确认还是取消, 挺有用的:
if inputbox('加法题','7+5','')='12' then
showmessage('yes')
else
showmessage('no')
点取消和不等于该函数的第三个参数都返回false;
var
inputtext:string;
if InputQuery('信息','请输入口令',inputtext)=true then
begin
end;
通过 InputBox 可获取用户输入的字符串:
procedure TForm1.Button1Click(Sender: TObject);var str: string;begin str := InputBox('输入窗口标题', '输入提示', '默认输入内容'); ShowMessage(str); //显示输入的内容end;
InputBox 是调用了 InputQuery, InputQuery 是通过一个 var 参数获取新字串:
procedure TForm1.Button2Click(Sender: TObject);var str: string;begin InputQuery('输入窗口标题', '输入提示', str); ShowMessage(str); //显示输入的内容end;
InputQuery 可返回一个 Boolean 值, 可判断用户是确认还是取消, 挺有用的:
procedure TForm1.Button3Click(Sender: TObject);var str: string;begin str := '默认输入内容'; if InputQuery('输入窗口标题', '输入提示', str) then ShowMessage(str); //如果点击了 ok 按钮将显示输入的内容end;
0 0
- Delphi中Inputbox 和Inputquery 函数的使用
- Delphi中Inputbox 和Inputquery 函数的使用
- Delphi:InputQuery和InputBox的区别
- Delphi Inputbox,InputQuery用法
- delphi 弹出输入框的InputQuery, InputQuery 函数用法
- 【VBA研究】VBA的InputBox函数和Application的InputBox方法
- .net C# inputBox文字输入对话框,类似delphi的inputBox
- .net C# inputBox文字输入对话框,类似delphi的inputBox
- C# inputBox文字输入对话框,类似delphi的inputBox
- msgbox函数和inputbox函数应该注意的几点
- inputbox()和val(inputbox())
- InputBox函数和MsgBox函数综合示例
- InputBox函数和MsgBox函数综合示例
- InputBox函数
- VBA的inputBox函数的JScript模拟
- .net C# inputBox文字输入对话框,类似delphi的inputBox收藏
- 自定义的InputBox函数(C#)
- 設置InputQuery的字体
- android 7.0从相册或拍照获取图片并剪切,包含权限获取
- 【C语言训练】百钱百鸡问题
- JAVA多线程入门
- Rsync+inotify 实时同步
- 打包好的apk放到手机上可以跑起来,但一尝试登陆就挂了。
- Delphi中Inputbox 和Inputquery 函数的使用
- ORACLE 在AZURE云上准备预发布数据库环境
- FineUI 的 Layout="Anchor" 布局 asp 的
- 基于C++实现一个简单的智能指针类
- 打印100~200之间的素数
- vim编辑器中整段代码的移动
- Symmetric Tree
- 碰撞冲击仿真
- 面试题------字符串翻转I am a student