本文整理自网络,侵删。
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 获取android package name:
Delphi tlistview(tlistbox+图标显示)
如何用Delphi实现windows xp中“本地连接”的启用和禁用
Delphi 错误no ftp list parsers have been registered
Delphi tbitmap创建时提示object or class type required
Delphi+access错误"不正常地定义参数对象。提供了不一致或不完整的信息。"
更多相关阅读请进入《Delphi》频道 >>