Description |
The ShowMessagePos procedure displays a string of Text in a simple dialog with an OK button at the given XPos, YPos screen coordinates.
The dialog is positioned with its top left at the given screen pixel coordinates.
This dialog is used to inform the user of some information - no decision is needed by the user.
Insert carriage return and line feed characters (#13#10) into the string to generate multi line message display.
|
|
Related commands |
InputBox |
|
Display a dialog that asks for user text input, with default |
InputQuery |
|
Display a dialog that asks for user text input |
MessageDlg |
|
Displays a message, symbol, and selectable buttons |
MessageDlgPos |
|
Displays a message plus buttons at a given screen position |
PromptForFileName |
|
Shows a dialog allowing the user to select a file |
ShowMessage |
|
Display a string in a simple dialog with an OK button |
ShowMessageFmt |
|
Display formatted data in a simple dialog with an OK button |
|
|
|
|
Example code : Show the message dialog at default and selected screen coordinates |
// Full Unit code. // ----------------------------------------------------------- // You must store this code in a unit called Unit1 with a form // called Form1 that has an OnCreate event called FormCreate. unit Unit1; interface uses Forms, Dialogs; type TForm1 = class(TForm) procedure FormCreate(Sender: TObject); end; var Form1: TForm1; implementation {$R *.dfm} // Include form definitions procedure TForm1.FormCreate(Sender: TObject); begin // Show a simple message at the default coordinates
ShowMessage('Hello World');
// Show a simple message at screen position 100, 200
ShowMessagePos('Hello World', 100, 200);
end; end.
|
Hide full unit code |
The following is displayed at the screen centre:
Hello World
The following is displayed at position 100,200:
Hello World
|
|