Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2002-05

An example for MessageBox

3 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Mattias Gaertner
to NORBERT ALLAIN: I don't understand how to use the MessageBox procedure. An example please. Thanks Norbert
GMT NORBERT ALLAIN wrote
I don't understand how to use the MessageBox procedure. An example please.

The Application.MessageBox exists only for Delphi compatibility. It just calls MessageDlg, which has some more features.

For example:
Add Dialogs to your uses section.

procedure TForm1.Button1CLICK(Sender: TObject);
begin
  if MessageDlg('Caption','Text',mtInformation,[mbOk,mbCancel],0)=mrOk then
    Application.MessageBox('You pressed ok','Caption',MB_OK);
end;

Mattias

Reply by email

Keith Bowes
to NORBERT ALLAIN
Mattias Gaertner wrote
The Application.MessageBox exists only for Delphi compatibility. It just

calls MessageDlg, which has some more features.

Show quoted text 7 lines
For example: Add Dialogs to your uses section. procedure TForm1.Button1CLICK(Sender: TObject); begin if MessageDlg('Caption','Text',mtInformation,[mbOk,mbCancel],0)=mrOk

then

Application.MessageBox('You pressed ok','Caption',MB_OK); end;

There's also a MessageBox function in the unit LCLLinux. This function takes four parameters instead of three; the first parameter is the handle of the owning window. In the win32 interface, LCLLinux's MessageBox function creates a native message box but Application.MessageBox creates a cross-platform message-box-esque window.

Keith

Reply by email