uses Dialogs;procedure TForm1.Button1Click(Sender: TObject);
var
InputString: string;
begin
InputString:= InputBox('Input Box', 'Prompt', 'Default string');end;
var
InputString: string;
begin
InputString:= InputBox('Input Box', 'Prompt', 'Default string');end;
解决方案 »
- Windows的搜索功能为什么那么差劲?
- 请问谁能待做计算机系毕业设计(哈尔滨),价钱面议
- 请求各位大哥帮忙!关于delphi的SQL问题!!!!!!!!
- 用ADO查询sql explor中的数据总是提示参数错误
- delphi6中怎么样统和查询
- 鼓足很大的勇气迈出了第一步。同胞们,需要你们的祝福。
- 高分求Delphi 2005的license,网上的算号器只能用29天
- 如何把image中图像存入dbgrid
- bpl包编程时两个包之间数据怎么互相访问,能否调用对方函数?
- 挑战高手:有谁回答上我的问题,我给他钱!看来给分是不行了,问半天没人能答上来,唉!
- 怎么取得一个机器中网卡的序列号??
- 请问 LoadBitmap(hInstance, 'BACKGROUND') 此函数的BACKGROUND windows资源自代马?
var
InputString: string;
begin
InputString := Caption;
if not InputQuery('Input Box', 'Prompt', InputString) then Exit;
Caption := InputString;
end;
begin
form1.Height:=edit1.Height;
form1.Width:=edit1.Width;
edit1.Top:=0;
edit1.Left:=0;
form1.BorderStyle:=bsnone;
end;end.这种方法一定行,试试吧。
函数声明:function InputBox(const ACaption, APrompt, ADefault: string): string;
描述:Description
Call InputBox to bring up an input dialog box ready for the user to enter a string in its edit box. ACaption is the caption of the dialog box.APrompt is the text that prompts the user to enter input in the edit box.ADefault is the string that appears in the edit box when the dialog box first appears.If the user chooses the Cancel button, InputBox returns the default string. If the user chooses the OK button, InputBox returns the string in the edit box.Use the InputBox function when there is a default value that should be used when the user chooses the Cancel button (or presses Esc) to exit the dialog. If the application needs to know whether the user chooses OK or Cancel, use the InputQuery function instead.例程:
uses Dialogs;procedure TForm1.Button1Click(Sender: TObject);
var
InputString: string;
begin
InputString:= InputBox('Input Box', 'Prompt', 'Default string');end;
也可用Delphi给的InputBox,很简单的,如果不明白的话,你可以看一下它的Help中的Sample