Go back to Richel Bilderbeek's homepage.

Go back to Richel Bilderbeek's C++ page.

 

 

 

( C++ VCL ) MessageDlg

 

A dialog posing a question that can be answered by yes/no/cancel/etc.

 

To use MessageDlg , #include the header file dialogs.hpp.

 

Example

 

 

MessageDlg("You want me to give you this message?", //Message

mtConfirmation, //Message type

TMsgDlgButtons() << mbYes << mbNo, //Buttons

0); //Help Context

 

 

Use of MessageDlg

 

 

const int returnValue = MessageDlg(AnsiString Msg, //Message

TMsgDlgType DlgType, //Message type

TMsgDlgButtons Buttons, //Buttons

int HelpCtx); //Help context

 

 

Possible return values are:

 

 

mrOK, mrCancel, mrYes, mrNo, mrAbort, mrRetry, mrIgnore

 

 

Possible message dialog types are:

 

 

enum TMsgDlgType {

mtWarning,

mtError,

mtInformation,

mtConfirmation,

myCustom

};

 

 

Possible buttons are:

 

 

enum TMsgDlgBtn {

mbYes,

mbNo,

mbOK,

mbCancel,

mbAbort,

mbRetry,

mbIgnore,

mbAll,

mbNoToAll,

mbYesToAll,

mbHelp

};

 

 

Because TMsgDlgButtons is a set, you use it e.g. by:

 

 

TMsgDlgButtons() << mbYes << mbNo; //Etcetera

 

 

List of dialogs (incomplete)

*        ShowMessage: the VCL equivalent of std::cout

*        MessageDlg: A yes/no/cancel/etc. dialog box.

*        InputBox: Ask the user for a value

*        InputQuery: Ask the user for a value

 

 

Go back to Richel Bilderbeek's C++ page.

Go back to Richel Bilderbeek's homepage.