The show dialog activity can be used to show information to the user and/or to ask for user input.
Activity properties
begin var DialogResult: Integer; DialogResult := MessageDlg('This is a codolex dialog', TMsgDlgType.mtInformation, [TMsgDlgBtn.mbOK, TMsgDlgBtn.mbIgnore], 0); end; |
Resulting code
The message text needs to be a string.
The message type defines the type of the dialog, 1 must be selected
The buttons provide options for the user, multiple options are possible. If no option is selected, the Ok button is shown. This defines the result integer options.
Ok -> 1
Cancel -> 2
Yes -> 6
No -> 7
Retry -> 4
Ignore -> 5
It's also possible to use the show dialog activity without 'Return value'. The result might not be needed in the case of just showing information. Turning of the return variable prevents hint's from the RAD Studio editor about unused variables.