MessageDlgInformation (Delphi)

From RAD Studio Code Examples
Jump to: navigation, search

Description

This example shows to you how to use function MessageDlg to create an Information Dialog.

Screenshot

Picture MessageDlg Information Delphi XE2.png
Information Dialog

Code

unit Unit1;

interface

uses
  Winapi.Windows,
  Winapi.Messages,
  System.SysUtils,
  System.Variants,
  System.Classes,
  Vcl.Graphics,
  Vcl.Controls,
  Vcl.Forms,
  Vcl.Dialogs, // Automatically added by IDE
  Vcl.StdCtrls;

type
  TForm1 = class(TForm)
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
MessageDlg( 'This is your account.'             +#13+
            'Name: Eko Indriyawan'              +#13+
            'Mobile Number: +6285655022205'     +#13+
            'Email: ekoindri@ekoindri.com',
            mtInformation,
            [mbOK],
            0);
end;

end.

Notes

  1. If you want to make an Information Dialog more simple, please use procedure ShowMessage instead.

Uses

See Also