Delphi Programming RTL Reference|By Category|Alphabetically|By Unit
type TMsgDlgType = (mtWarning, mtError, mtInformation, mtConfirmation, mtCustom);
type TMsgDlgBtn = (mbYes, mbNo, mbOK, mbCancel, mbAbort, mbRetry, mbIgnore, mbAll, mbNoToAll, mbYesToAll, mbHelp);
type TMsgDlgButtons = set of TMsgDlgBtn;
function CreateMessageDialog(const Msg: string; DlgType: TMsgDlgType; Buttons: TMsgDlgButtons): TForm;
Returns a specified message dialog, does not display the dialog form.
Use CreateMessageDialog to create a message dialog that will be used several times in an application.
CreateMessageDialog does not show the created dialog form. The application must display this form when it is needed by calling its ShowModal method.
//could be global variable - declared in
//the interface section of some unit
var myDLG : TForm;
//in MainForm OnCreate
myDLG := CreateMessageDialog('This is a shareware warning!', mtWarning, [mbOk]);
//several times "anywhere" - in any handler needed
myDLG.ShowModal;
//in MainForm OnDestroy
myLDG.Release;
|
Working with dialogs
A set of articles and tips to help you learn working with common dialog boxes and extend your knowledge on advanced dialog usage.
ShowMessage,
ShowMessageFmt,
|
Free Delphi code snippet inside every Delphi Newsletter! |
|
|
|
Got some code to share? Got a question? Need some help? |
|
|