VsShellUtilities.ShowMessageBox Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
ShowMessageBox(IServiceProvider, String, String, String, UInt32, OLEMSGICON, OLEMSGBUTTON, OLEMSGDEFBUTTON, Boolean, Boolean)
Show message box.
public static Microsoft.VisualStudio.Shell.Interop.ExtendedMessageBoxResult ShowMessageBox (IServiceProvider serviceProvider, string message, string? title, string? helpFile, uint helpId, Microsoft.VisualStudio.Shell.Interop.OLEMSGICON icon, Microsoft.VisualStudio.Shell.Interop.OLEMSGBUTTON msgButton, Microsoft.VisualStudio.Shell.Interop.OLEMSGDEFBUTTON defaultButton, bool allowSuppression, out bool suppressed);
static member ShowMessageBox : IServiceProvider * string * string * string * uint32 * Microsoft.VisualStudio.Shell.Interop.OLEMSGICON * Microsoft.VisualStudio.Shell.Interop.OLEMSGBUTTON * Microsoft.VisualStudio.Shell.Interop.OLEMSGDEFBUTTON * bool * bool -> Microsoft.VisualStudio.Shell.Interop.ExtendedMessageBoxResult
Public Function ShowMessageBox (serviceProvider As IServiceProvider, message As String, title As String, helpFile As String, helpId As UInteger, icon As OLEMSGICON, msgButton As OLEMSGBUTTON, defaultButton As OLEMSGDEFBUTTON, allowSuppression As Boolean, ByRef suppressed As Boolean) As ExtendedMessageBoxResult
Parameters
- serviceProvider
- IServiceProvider
The service provider
- message
- String
The message to show
- title
- String
The title of the message box
- helpFile
- String
- helpId
- UInt32
- icon
- OLEMSGICON
The icon to show on the message box
- msgButton
- OLEMSGBUTTON
The button type
- defaultButton
- OLEMSGDEFBUTTON
The default button
- allowSuppression
- Boolean
Indicates whether the message box can be suppressed
- suppressed
- Boolean
Indicates whether the message box was suppressed
Returns
The result of the message box.
Applies to
ShowMessageBox(IServiceProvider, String, String, String, OLEMSGICON, OLEMSGBUTTON, OLEMSGDEFBUTTON, Boolean, Boolean)
Show message box.
public static Microsoft.VisualStudio.Shell.Interop.ExtendedMessageBoxResult ShowMessageBox (IServiceProvider serviceProvider, string message, string? title, string? helpTopic, Microsoft.VisualStudio.Shell.Interop.OLEMSGICON icon, Microsoft.VisualStudio.Shell.Interop.OLEMSGBUTTON msgButton, Microsoft.VisualStudio.Shell.Interop.OLEMSGDEFBUTTON defaultButton, bool allowSuppression, out bool suppressed);
static member ShowMessageBox : IServiceProvider * string * string * string * Microsoft.VisualStudio.Shell.Interop.OLEMSGICON * Microsoft.VisualStudio.Shell.Interop.OLEMSGBUTTON * Microsoft.VisualStudio.Shell.Interop.OLEMSGDEFBUTTON * bool * bool -> Microsoft.VisualStudio.Shell.Interop.ExtendedMessageBoxResult
Public Function ShowMessageBox (serviceProvider As IServiceProvider, message As String, title As String, helpTopic As String, icon As OLEMSGICON, msgButton As OLEMSGBUTTON, defaultButton As OLEMSGDEFBUTTON, allowSuppression As Boolean, ByRef suppressed As Boolean) As ExtendedMessageBoxResult
Parameters
- serviceProvider
- IServiceProvider
The service provider
- message
- String
The message to show
- title
- String
The title of the message box
- helpTopic
- String
The help topic
- icon
- OLEMSGICON
The icon to show on the message box
- msgButton
- OLEMSGBUTTON
The button type
- defaultButton
- OLEMSGDEFBUTTON
The default button
- allowSuppression
- Boolean
Indicates whether the message box can be suppressed
- suppressed
- Boolean
Indicates whether the message box was suppressed
Returns
The result of the message box.
Applies to
ShowMessageBox(IServiceProvider, String, String, String, UInt32, OLEMSGICON, OLEMSGBUTTON, OLEMSGDEFBUTTON)
Show message box.
public static Microsoft.VisualStudio.Shell.Interop.ExtendedMessageBoxResult ShowMessageBox (IServiceProvider serviceProvider, string message, string? title, string? helpFile, uint helpId, Microsoft.VisualStudio.Shell.Interop.OLEMSGICON icon, Microsoft.VisualStudio.Shell.Interop.OLEMSGBUTTON msgButton, Microsoft.VisualStudio.Shell.Interop.OLEMSGDEFBUTTON defaultButton);
static member ShowMessageBox : IServiceProvider * string * string * string * uint32 * Microsoft.VisualStudio.Shell.Interop.OLEMSGICON * Microsoft.VisualStudio.Shell.Interop.OLEMSGBUTTON * Microsoft.VisualStudio.Shell.Interop.OLEMSGDEFBUTTON -> Microsoft.VisualStudio.Shell.Interop.ExtendedMessageBoxResult
Public Function ShowMessageBox (serviceProvider As IServiceProvider, message As String, title As String, helpFile As String, helpId As UInteger, icon As OLEMSGICON, msgButton As OLEMSGBUTTON, defaultButton As OLEMSGDEFBUTTON) As ExtendedMessageBoxResult
Parameters
- serviceProvider
- IServiceProvider
The service provider
- message
- String
The message to show
- title
- String
The title of the message box
- helpFile
- String
- helpId
- UInt32
- icon
- OLEMSGICON
The icon to show on the message box
- msgButton
- OLEMSGBUTTON
The button type
- defaultButton
- OLEMSGDEFBUTTON
The default button
Returns
The result of the message box.
Applies to
ShowMessageBox(IServiceProvider, String, String, String, OLEMSGICON, OLEMSGBUTTON, OLEMSGDEFBUTTON)
Show message box.
public static Microsoft.VisualStudio.Shell.Interop.ExtendedMessageBoxResult ShowMessageBox (IServiceProvider serviceProvider, string message, string? title, string? helpTopic, Microsoft.VisualStudio.Shell.Interop.OLEMSGICON icon, Microsoft.VisualStudio.Shell.Interop.OLEMSGBUTTON msgButton, Microsoft.VisualStudio.Shell.Interop.OLEMSGDEFBUTTON defaultButton);
static member ShowMessageBox : IServiceProvider * string * string * string * Microsoft.VisualStudio.Shell.Interop.OLEMSGICON * Microsoft.VisualStudio.Shell.Interop.OLEMSGBUTTON * Microsoft.VisualStudio.Shell.Interop.OLEMSGDEFBUTTON -> Microsoft.VisualStudio.Shell.Interop.ExtendedMessageBoxResult
Public Function ShowMessageBox (serviceProvider As IServiceProvider, message As String, title As String, helpTopic As String, icon As OLEMSGICON, msgButton As OLEMSGBUTTON, defaultButton As OLEMSGDEFBUTTON) As ExtendedMessageBoxResult
Parameters
- serviceProvider
- IServiceProvider
The service provider
- message
- String
The message to show
- title
- String
The title of the message box
- helpTopic
- String
The help topic
- icon
- OLEMSGICON
The icon to show on the message box
- msgButton
- OLEMSGBUTTON
The button type
- defaultButton
- OLEMSGDEFBUTTON
The default button
Returns
The result of the message box.
Applies to
ShowMessageBox(IServiceProvider, String, String, OLEMSGICON, OLEMSGBUTTON, OLEMSGDEFBUTTON)
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);
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.