![cppcolors | Embarcadero RAD Studio Delphi C++Builder Blogs](https://i0.wp.com/blogs.embarcadero.com/wp-content/uploads/2020/08/cpp_colors.jpg?resize=1140%2C628&ssl=1)
function MessageDlg(const AMessage: string; const ADialogType: TMsgDlgType; const AButtons: TMsgDlgButtons;
const AHelpContext: THelpContext): Integer; overload; inline; deprecated ‘Use FMX.DialogService methods’;
class procedure ShowMessage(const AMessage: string); overload;
class procedure ShowMessage(const AMessage: string; const ACloseDialogProc: TInputCloseDialogProc); overload;
class procedure ShowMessage(const AMessage: string; const ACloseDialogEvent: TInputCloseDialogEvent;
const AContext: TObject = nil); overload;
procedure TForm2.btnShowMessageClick(Sender: TObject);
begin
TDialogService.ShowMessage(‘您點選了OK按鈕‘, ShowMessageCloseMethod);
end;
procedure TForm2.ShowMessageCloseMethod(const AResult: TModalResult);
var
alvi : TListViewItem;
begin
alvi := ListView1.Items.Add;
alvi.Text := DateTimeToStr(Now);
alvi.Detail := ‘關閉了ShowMessage對話盒!’;
end;
![](https://i0.wp.com/community.embarcadero.com/uploads/6149/20180108-1.png?resize=305%2C542&ssl=1)
![](https://i0.wp.com/community.embarcadero.com/uploads/6149/20180108-2.png?resize=305%2C542&ssl=1)
Design. Code. Compile. Deploy.
Start Free Trial Upgrade Today
Free Delphi Community Edition Free C++Builder Community Edition