Welcome to the new DelphiDabbler Code Library Documentation.

This is a new site that's currently running on alpha code. There are going to be bugs. If you discover any, please report them on the site's issues page (GitHub account required). Thanks.

Warning: Many URLs are going to change. Refer to the README file to discover which library project's documentation has been completed.


Project: Message Dialogue Components.

Unit: PJMessageDialog.

Applies to: ~>3.0

TPJVCLMsgDlg provides a customisable message dialogue box that is based on that provided by the Delphi CreateMessageDialog function. The component provides a similar (but extended) interface to the TPJWinMsgDlg component but uses a different method to display the dialogue box. This component is recommended when a finer degree of control to that provided by TPJWinMsgDlg is required.

The text displayed in the dialogue box is determined by the Text property. Various button groupings can be displayed using the ButtonGroup and/or Buttons properties. Setting a non-zero HelpContext causes a help button to be displayed. The Kind property allows a choice of various standard dialogue boxes and icons to be displayed. A user defined icon extracted from a named resource, specified by IconResource can also be displayed. The window title can be customised using the Title property, otherwise a default title is used that is related to the kind of icon being displayed. The MakeSound property determines whether an appropriate system sound is generated when the dialogue is displayed. It is possible to set how the dialogue box is to be aligned to screen or form using the Align property in combination with the OffsetLeft and OffsetTop properties.

The dialogue box can be invoked with the Execute method or an instance of the dialogue can be created using the CreateDialog method. In the latter case the user has responsibility for showing and hiding the dialogue and destroying the instance.


Method Description
CreateDialog Creates instance of the dialogue box and returns a reference to it.
Execute Displays the dialogue box and returns information about the button pressed to close it.


Property Description
Align Determines the on screen alignment of the dialogue box.
ButtonGroup Determines which buttons appear in the dialogue box.
Buttons Determines the buttons displayed in the dialogue box . Provides finer control than ButtonGroup.
DefButton Determines the default button in the dialogue box.
DlgType Permits the buttons and type of dialogue box displayed to be specified by means of the flags that are passed to the uType parameter of the Windows MessageBox API function.
HelpContext Specifies the context number for online help.
HelpFile Specifies the file to use for online help.
IconResource Specifies the resource containing the dialogue box’s icon.
Kind Determines the type of dialogue box that is displayed.
MakeSound Flag that determines if a sound will be emitted when the dialogue box is displayed.
OffsetLeft Determines the offset of the dialogue box from the left of the screen or owning form.
OffsetTop Determines the offset of the dialogue box from the top of the screen or owning form.
Options Property that records various customisation options.
Text The text that is displayed in the dialogue box.
Title The dialogue box’s window title.


Event Description
OnHelp Event triggered when a user requests help in a dialogue box.
OnHide Event triggered just after the component’s dialogue box is hidden.
OnShow Event triggered just before the component’s dialogue box is displayed.