[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] |
Display an message dialog with response buttons.
Source position: forms.pp line 1624
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 message box. |
Can be one of the following values:
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 the Dialogs unit.
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].
|
Shows a message to the user and gets the response. |
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;
Version 4.0 | Generated 2025-05-03 | Home |