[lazarus] An example for MessageBox

Keith Bowes keith_bowes at hotmail.com
Thu May 9 08:17:08 EDT 2002


Mattias Gaertner <nc-gaertnma at netcologne.de> wrote:
>
> 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;
>

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






More information about the Lazarus mailing list