Compartilhar via


DialogHelper.ShowMessageBox Method (IWin32Window, String, String, MessageBoxButtons, MessageBoxIcon, MessageBoxDefaultButton)

Displays a message box that is modal to the specified parent.

Namespace: Microsoft.ConfigurationManagement.AdminConsole
Assembly: Microsoft.ConfigurationManagement (in microsoft.configurationmanagement.dll)

Usage

'Usage
Dim parent As IWin32Window
Dim text As String
Dim caption As String
Dim buttons As MessageBoxButtons
Dim icon As MessageBoxIcon
Dim defaultButton As MessageBoxDefaultButton
Dim returnValue As DialogResult

returnValue = DialogHelper.ShowMessageBox(parent, text, caption, buttons, icon, defaultButton)

Syntax

'Declaration
Public Shared Function ShowMessageBox ( _
    parent As IWin32Window, _
    text As String, _
    caption As String, _
    buttons As MessageBoxButtons, _
    icon As MessageBoxIcon, _
    defaultButton As MessageBoxDefaultButton _
) As DialogResult
public static DialogResult ShowMessageBox (
    IWin32Window parent,
    string text,
    string caption,
    MessageBoxButtons buttons,
    MessageBoxIcon icon,
    MessageBoxDefaultButton defaultButton
)
public:
static DialogResult ShowMessageBox (
    IWin32Window^ parent, 
    String^ text, 
    String^ caption, 
    MessageBoxButtons buttons, 
    MessageBoxIcon icon, 
    MessageBoxDefaultButton defaultButton
)
public static DialogResult ShowMessageBox (
    IWin32Window parent, 
    String text, 
    String caption, 
    MessageBoxButtons buttons, 
    MessageBoxIcon icon, 
    MessageBoxDefaultButton defaultButton
)
public static function ShowMessageBox (
    parent : IWin32Window, 
    text : String, 
    caption : String, 
    buttons : MessageBoxButtons, 
    icon : MessageBoxIcon, 
    defaultButton : MessageBoxDefaultButton
) : DialogResult

Parameters

  • parent
    [in] System.Windows.Forms.IWin32Window object that represents the parent.
  • text
    [in] Message box text.
  • caption
    [in] Message box caption.
  • buttons
    [in] System.Windows.Forms.MessageBoxButtons object.
  • icon
    [in] System.Windows.Forms.MessageBoxIcon object.
  • defaultButton
    [in] System.Windows.Forms.MessageBoxDefaultButton object.

Return Value

System.Windows.Forms.DialogResult enumeration value.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

Windows Server 2003, Windows Vista

Target Platforms

Windows Server 2003,Windows Vista

See Also

Reference

DialogHelper Class
DialogHelper Members
Microsoft.ConfigurationManagement.AdminConsole Namespace