0% found this document useful (0 votes)
183 views

Message DLG in Delphi (Function)

The document defines two types used to customize message boxes in Delphi: TMsgDlgType defines the different types of message boxes like warning, error, information, or confirmation. TMsgDlgButtons defines the buttons that can appear in a message box, like Yes, No, OK, Cancel, as well as common pre-defined button combinations. The example code shows how to display a confirmation message box in Delphi with Yes and No buttons, and close the form if the user clicks Yes.

Uploaded by

Lissa Raboek
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
183 views

Message DLG in Delphi (Function)

The document defines two types used to customize message boxes in Delphi: TMsgDlgType defines the different types of message boxes like warning, error, information, or confirmation. TMsgDlgButtons defines the buttons that can appear in a message box, like Yes, No, OK, Cancel, as well as common pre-defined button combinations. The example code shows how to display a confirmation message box in Delphi with Yes and No buttons, and close the form if the user clicks Yes.

Uploaded by

Lissa Raboek
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Function MessageDlg(const Msg: string; DlgType: TMsgDlgType; Buttons: TMsgDlgButtons; HelpCtx: Longint): Word;

TMsgDlgType defines values describing the type of message box. Delphi syntax: type TMsgDlgType = (mtWarning, mtError, mtInformation, mtConfirmation, mtCustom); Description The TMsgDlgType type defines the values describing the type of a message box. The TMsgDlgType is used by the MessageDlg and MessageDlgPos functions. The following table lists the possible values: mtWarning mtError mtInformation mtConfirmation mtCustom A message box containing a yellow exclamation point symbol. A message box containing a red stop sign. A message box containing a blue "i". A message box containing a green question mark. A message box containing no bitmap. The caption of the message box is the name of the application's executable file.

TMsgDlgButtons defines a set of values used by MessageDlg and MessageDlgPos. Delphi syntax: TMsgDlgBtn = (mbYes, mbNo, mbOK, mbCancel, mbAbort, mbRetry, mbIgnore, mbAll, mbNoToAll, mbYesToAll, mbHelp); TMsgDlgButtons = set of TMsgDlgBtn; const mbYesNoCancel = [mbYes, mbNo, mbCancel]; mbYesAllNoAllCancel = [mbYes, mbYesToAll, mbNo, mbNoToAll, mbCancel]; mbOKCancel = [mbOK, mbCancel]; mbAbortRetryIgnore = [mbAbort, mbRetry, mbIgnore]; mbAbortIgnore = [mbAbort, mbIgnore]; Description The TMsgDlgButtons type defines the set of values a button in a message box can have. The TMsgDlgButtons type is used by the MessageDlg and MessageDlgPos functions. The following tables lists the possible values: mbYes mbNo mbOK mbCancel mbAbort mbRetry mbIgnore mbAll mbNoToAll mbYesToAll mbHelp A button with 'Yes' on its face. A button the text 'No' on its face. A button the text 'OK' on its face. A button with the text 'Cancel' on its face. A button with the text 'Abort' on its face A button with the text 'Retry' on its face A button the text 'Ignore' on its face A button with the text 'All' on its face A button with the text 'No to All' on its face A button with the text 'Yes to All' on its face A button with the text 'Help' on its face

Procedure TForm1.Button1Click(Sender: TObject); Begin If MessageDlg('Ki akarsz lpni?',mtConfirmation,[mbYes,mbNo],0)=mrYes then Close; End;

You might also like