[This is preliminary documentation and is subject to change.]

Displays a message in a dialog box, waits for the user to click a button, and then returns an integer indicating which button the user clicked.

Namespace: Tools.WindowsT.IndependentT
Assembly: Tools.Windows (in Tools.Windows.dll) Version: 1.5.3.38916 (1.5.3.38916)

Syntax

C#
public static MsgBoxResult MsgBox(
	Object Prompt,
	MsgBoxStyle Buttons,
	Object Title,
	Object owner
)
Visual Basic
Public Shared Function MsgBox ( _
	Prompt As Object, _
	Buttons As MsgBoxStyle, _
	Title As Object, _
	owner As Object _
) As MsgBoxResult
Visual C++
public:
static MsgBoxResult MsgBox(
	Object^ Prompt, 
	MsgBoxStyle Buttons, 
	Object^ Title, 
	Object^ owner
)
F#
static member MsgBox : 
        Prompt:Object * 
        Buttons:MsgBoxStyle * 
        Title:Object * 
        owner:Object -> MsgBoxResult 
JScript
public static function MsgBox(
	Prompt : Object, 
	Buttons : MsgBoxStyle, 
	Title : Object, 
	owner : Object
) : MsgBoxResult

Parameters

Prompt
Type: System..::..Object
Required. String expression displayed as the message in the dialog box.
Buttons
Type: Microsoft.VisualBasic..::..MsgBoxStyle
Optional. Numeric expression that is the sum of values specifying the number and type of buttons to display, the icon style to use, the identity of the default button, and the modality of the message box. If you omit Buttons, the default value is zero. Values Critical, Exclamation and Question are associated with appropriate SystemSounds.
Title
Type: System..::..Object
Optional. String expression displayed in the title bar of the dialog box. If you omit Title, the application name is placed in the title bar.
owner
Type: System..::..Object

[Missing <param name="owner"/> documentation for "M:Tools.WindowsT.IndependentT.MessageBox.MsgBox(System.Object,Microsoft.VisualBasic.MsgBoxStyle,System.Object,System.Object)"]

Return Value

The result of message box indicatin pressed button.

Remarks

This function mimisc behaviour of the MsgBox(Object, MsgBoxStyle, Object) function

Exceptions

ExceptionCondition
System.Reflection..::..TargetInvocationExceptionThere was an error working working with customized static properties such as DefaultImplementation or message box implementation failed.

See Also

Collapse/expand Version History

1.5.3

  • (Beta) Added parameter owner because using MsgBox(Object, MsgBoxStyle, Object, Object) without owner caused bad behavior in WPF applications.