Solved

how do i put a message box in a component?

Posted on 1998-02-03
4
165 Views
Last Modified: 2010-04-04
i am writing a component which pops up a message box
which asks the user whether he wants to close a form
when he presses on the component..the component is
derived from tbutton
how do i make the message box pop up?
0
Comment
Question by:superboy
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 4

Accepted Solution

by:
StevenB earned 0 total points
ID: 1358225
 Use the MessageDlg or ShowMessage functions.

  Steven.
0
 
LVL 4

Expert Comment

by:tomerlei
ID: 1358226
how to use messagegdlg?
0
 
LVL 4

Expert Comment

by:StevenB
ID: 1358227
 I really don't think that I can explain it any better than the delphi help:

MessageDlg displays a message dialog box in the center of the screen.

Unit
Dialogs

Category
dialog and message routines

function MessageDlg(const Msg: string; AType: TMsgDlgType; AButtons: TMsgDlgButtons; HelpCtx: Longint): Word;

Description
Call MessageDlg to bring up a message box and obtain the user's response. The message box displays the value of the Msg parameter.  Use the AType parameter to indicate the purpose of the dialog.  Use the AButtons parameter to indicate what buttons should appear in the message box.  Use the HelpCtx parameter to specify the context ID for the help topic that should appear when the user clicks the help button or presses F1 while the dialog is displayed.
MessageDlg returns the value of the button the user selected. These are the possible return values:

Return values            
mrNone          mrAbort         mrYes
mrOK            mrRetry         mrNo
mrCancel        mrIgnore        mrAll


TMsgDlgType defines values describing the type of message box.

  type TMsgDlgType = (mtWarning, mtError, mtInformation, mtConfirmation, mtCustom);

Description
The TMsgDlgType type defines the values describing the type of message box. The TMsgDlgType is used by the MessageDlg and MessageDlgPos functions. The following table lists the possible values:

mtWarning       A message box containing a yellow exclamation point symbol.
mtError         A message box containing a red stop sign.
mtInformation   A message box containing a blue "i".
mtConfirmation  A message box containing a green question mark.
mtCustom        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.

type

  TMsgDlgBtn = (mbYes, mbNo, mbOK, mbCancel, mbAbort, mbRetry, mbIgnore, mbAll, mbHelp);

  TMsgDlgButtons = set of TMsgDlgBtn;

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:

Value      Meaning
mbYes            A button with a green check mark and the text 'Yes' on its face
mbNo            A button with a red circle and slash mark through the circle and the text 'No' on its face
mbOK            A button with a green check mark and the text 'OK' on its face
mbCancel      A button with a red X and the text 'Cancel' on its face
mbHelp        A button with a cyan question mark and the text 'Help' on its face
mbAbort       A button with a red check mark and the text 'Abort' on its face
mbRetry       A button with two green circular arrows and the text 'Retry' on its face
mbIgnore      A button with a green man walking away and the text 'Ignore' on its face
mbAll         A button with a green double check marks and the text 'All' on its face



0
 
LVL 4

Expert Comment

by:StevenB
ID: 1358228
"Regarding superboy's question in the Experts Exchange(sm) Delphi Programming topic area titled "how do i put a message box in a component?"...

Congratulations!  You earned 0 quality points for answering superboy's question! These points will be added to your expert score in the Delphi Programming topic area."


Cheers Superboy. Its good to feel appreciated.




0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

737 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question