Vcl.Dialogs.ShowMessage
Delphi
procedure ShowMessage(const Msg: string);
procedure ShowMessage(const Msg: string; TaskDlgFlags: TTaskDialogFlags);
C++
extern DELPHI_PACKAGE void __fastcall ShowMessage(const System::UnicodeString Msg)/* overload */;
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
procedure function |
public | Vcl.Dialogs.pas Vcl.Dialogs.hpp |
Vcl.Dialogs | Vcl.Dialogs |
Description
Displays a message box with an OK button.
Call ShowMessage to display a simple message box with an OK button. The name of the application's executable file appears as the caption of the message box.
ShowMessage parameters are described below:
- Msg parameter is the message string that appears in the message box.
- TaskDlgFlags parameter is a set of flags, allowing to control a dialog behavior. The supported options are
tfAllowDialogCancellation
,tfSizeToContent
, andtfRtlLayout
. The default TaskDlgFlags is an empty set.
Note: The original ShowMessage uses
tfAllowDialogCancellation
as default, and under Right-to-left script tfRtlLayout
is added. No other default options are added.Note: To display a message in a message box with other buttons or icons, use the MessageDlg function.
Note: If the user types
Ctrl+C
in the message box, the text of the message is copied to the clipboard.See Also
- TTaskDialogFlag
- MessageDlg
- MessageDlgPos
- ShowMessageFmt
- TApplication
- ShowMessagePos
- Dialogs Support Routines