1. Home
  2. Computing & Technology
  3. Delphi Programming
Glossary|Tips/Tricks|FREE App/VCL|Best'O'Net|Books|Link Back

Delphi Programming RTL Reference|By Category|Alphabetically|By Unit
 

CreateMessageDialog

unit
Dialogs
category
Dialog and Message routines

declaration
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;

description
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.

example
//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; 


in real code
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.

see also
ShowMessage, ShowMessageFmt,


 Free Delphi code snippet inside every Delphi Newsletter!
Subscribe to the Newsletter
Name
Email

 Got some code to share? Got a question? Need some help?
Explore Delphi Programming
About.com Special Features

The Best Web Trends of the Decade

A look back at the best innovations, ideas and technologies over the last 10 years, More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

  1. Home
  2. Computing & Technology
  3. Delphi Programming

©2010 About.com, a part of The New York Times Company.

All rights reserved.