随笔分类 - Delphi / 组件
摘要:MessageBox对话框是一个最常用的对话框,用它显示提示信息最方便,也是最有效的手段 语法:function MessageBox(const Text, Caption:PChar; Flags:Longint):Integer; 参数Text是要显示的内容,Caption为对话框的,Flag
阅读全文
摘要:(1)Label控件显示多行文本 procedure TForm1.Button1Click(Sender: TObject); begin label1.Caption:= '第一行'#2'第二行'#10'第三行'; end; (2)Label控件显示超长文本时自动换行 只需要对Label的两
阅读全文
摘要:语法:function InputQuery(const ACaption, APrompt:string; var Value:string):Boolean; 参数ACaption为对话框标题,APrompt为输入提示语,Value为值。 procedure TForm1.btn1Click(S
阅读全文
摘要:(1)改造Edit只允许输入数字 procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char); begin if not (key in ['0'..'9',#8]) then begin showmessage('输入数字'); k
阅读全文