本文整理自网络,侵删。
procedure ShowInfo(const Text, Title: string);begin MessageBox(0, PChar(Text), PChar(Title), MB_OK or MB_ICONINFORMATION);end;
procedure ShowError(const Text: string; const Title: string = '');begin MessageBox(0, PChar(Text), PChar(Title), MB_OK or MB_ICONEXCLAMATION);end;
function ShowWarning(const Text: string; const Title: string = ''): Boolean;begin Result := MessageBox(0, PChar(Text), PChar(Title), MB_YESNO or MB_ICONWARNING or MB_DEFBUTTON2) = IDYES;end;
function ShowQuestion(const Text: string; const Title: string = ''): Boolean;begin Result := MessageBox(0, PChar(Text), PChar(Title), MB_YESNO or MB_ICONQUESTION) = IDYES;end;
procedure TForm1.Button1Click(Sender: TObject);
begin
ShowInfo('内容','标题');ShowError('内容','标题');if ShowWarning('内容','标题') then ShowMessage('yes');if ShowQuestion('内容','标题') then ShowMessage('yes');
end;
end.
相关阅读 >>
Delphi fdmemtable中如何在已有的字段数据集上加入字段
Delphi 取得开机时间 开机时间总长度(可精确到秒,分钟等)
Delphi winsoft comport for android usb
更多相关阅读请进入《Delphi》频道 >>