[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] |
Display an message dialog with several response buttons.
Source position: forms.pp line 1474
public function TApplication.MessageBox( |
Text: PChar; |
Caption: PChar; |
Flags: LongInt = MB_OK |
):Integer; |
Text |
|
The text in the MessageBox. |
Caption |
|
The Caption of the MessageBox. |
Flags |
|
The icon and buttons appearing in the box. |
Can be one of the following values:
IDOK
IDCANCEL
IDABORT
IDRETRY
IDIGNORE
IDYES
IDNO
IDCLOSE
IDHELP
The function is used internally to display messages during the handling of Exceptions, but is also available to application programmers as an alternative to some of the message dialogs found in Dialogs.
The function returns an integer value corresponding to the button that was pressed; its value can be determined by reference to the constants [IDOK..IDHELP].
|
Message Dialog |
Uses Forms, Dialogs, LCLType; Procedure DisplayMessageBox; var reply, boxstyle: integer; begin with application do begin boxstyle := MB_ICONQUESTION + MB_YESNO; reply := MessageBox ('Press either button', 'MessageBoxDemo', boxstyle); if reply = IDYES then MessageBox ('Yes ', 'Reply',MB_ICONINFORMATION) else MessageBox ('No ', 'Reply', MB_ICONHAND) end;
lazarus-ccr.sourceforge.net |