Partilhar via


VsShellUtilities.ShowMessageBox Method

Definition

Displays a message box with the specified message.

public:
 static int ShowMessageBox(IServiceProvider ^ serviceProvider, System::String ^ message, System::String ^ title, Microsoft::VisualStudio::Shell::Interop::OLEMSGICON icon, Microsoft::VisualStudio::Shell::Interop::OLEMSGBUTTON msgButton, Microsoft::VisualStudio::Shell::Interop::OLEMSGDEFBUTTON defaultButton);
public static int ShowMessageBox (IServiceProvider serviceProvider, string message, string title, Microsoft.VisualStudio.Shell.Interop.OLEMSGICON icon, Microsoft.VisualStudio.Shell.Interop.OLEMSGBUTTON msgButton, Microsoft.VisualStudio.Shell.Interop.OLEMSGDEFBUTTON defaultButton);
static member ShowMessageBox : IServiceProvider * string * string * Microsoft.VisualStudio.Shell.Interop.OLEMSGICON * Microsoft.VisualStudio.Shell.Interop.OLEMSGBUTTON * Microsoft.VisualStudio.Shell.Interop.OLEMSGDEFBUTTON -> int
Public Shared Function ShowMessageBox (serviceProvider As IServiceProvider, message As String, title As String, icon As OLEMSGICON, msgButton As OLEMSGBUTTON, defaultButton As OLEMSGDEFBUTTON) As Integer
Public Function ShowMessageBox (serviceProvider As IServiceProvider, message As String, title As String, icon As OLEMSGICON, msgButton As OLEMSGBUTTON, defaultButton As OLEMSGDEFBUTTON) As Integer

Parameters

serviceProvider
IServiceProvider

The service provider

message
String

The message to show

title
String

The title of the message box

icon
OLEMSGICON

The icon to show on the message box

msgButton
OLEMSGBUTTON

The button type

defaultButton
OLEMSGDEFBUTTON

The default button

Returns

If the method succeeds, it returns S_OK. If it fails, it returns an error code. If a referernce to the IVsUIShell interface cannot be retrived from the service provider then InvalidOperationException is thrown.

Applies to