Passa al contenuto principale

IndyMsgBox

Structure

IndyMsgBox(sText Text; bYesNo, bAllowHiding: Boolean)

Type

Function

Description

This function displays the sText text in a small dialog. If the bYesNo parameter is True then the dialog has 'Yes' and 'No' buttons, otherwise an 'OK' button is shown. If the bYesNo parameter is True then the function result is either 1 or 0 (integers), based on the 'Yes' or 'No' response, otherwise the result is always True. If the bAllowHiding parameter is True then a small checkbox is shown in the lower left of the dialog for 'Do Not Display This Message Again'. If this is checked by the user then (regardless of the yes/no/ok response) the dialog will not be shown again in the future for that workstation. (The checkbox answer is saved locally to the registry). If the dialog is hidden then the function always returns True in the future (if bYesNo is true).

Parameters: 3

sText = the text displayed in the dialog

bYesNo= If 'Yes' and 'No' buttons are shown or just an 'OK' button. See note above.

bAllowHiding= option to hide the dialog in the future. See note above.

Return Value

Text, '1' or '0'. Note: this '1' or '0' is automatically evaluated as a boolean when used in an 'if' statement, or 'if not', etc. See examples below. See note above.

Examples

' Yes/No question, no Hiding option

if not IndyMsgBox('Would you like to proceed?', True, False) then

AbortAction('You said no - so we stop')

Else

ShowMessage('Proceeding with the script')

End If

' Just text, with Hiding option

IndyMsgBox('This is new functionality, I am just explaining it here.', False, True) |