VsShellUtilities.ShowMessageBox 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
显示具有指定消息的消息框。
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
参数
- serviceProvider
- IServiceProvider
服务提供程序
- message
- String
要显示的消息
- title
- String
消息框的标题
- icon
- OLEMSGICON
要在消息框中显示的图标
- msgButton
- OLEMSGBUTTON
按钮类型
- defaultButton
- OLEMSGDEFBUTTON
默认按钮
返回
如果该方法成功,则它会返回 S_OK。 如果该方法失败,则会返回错误代码。 如果 IVsUIShell 接口的 referernce 无法从服务提供程序其检索,则将引发 InvalidOperationException。