要显示 shell 内的消息框可的帮助器方法。
命名空间: Microsoft.VisualStudio.Modeling.Shell
程序集: Microsoft.VisualStudio.Modeling.Sdk.Shell.12.0(在 Microsoft.VisualStudio.Modeling.Sdk.Shell.12.0.dll 中)
语法
声明
Public Shared Function ShowMessageBox ( _
serviceProvider As IServiceProvider, _
messageText As String, _
messageButtons As OLEMSGBUTTON, _
defaultButton As OLEMSGDEFBUTTON, _
messageIcon As OLEMSGICON _
) As DialogResult
public static DialogResult ShowMessageBox(
IServiceProvider serviceProvider,
string messageText,
OLEMSGBUTTON messageButtons,
OLEMSGDEFBUTTON defaultButton,
OLEMSGICON messageIcon
)
参数
- serviceProvider
类型:System.IServiceProvider
- messageText
类型:System.String
要显示的文本。
- messageButtons
类型:Microsoft.VisualStudio.Shell.Interop.OLEMSGBUTTON
应出现在对话框中的按钮。
- defaultButton
类型:Microsoft.VisualStudio.Shell.Interop.OLEMSGDEFBUTTON
默认按钮 (被调用时用户按回归)。
- messageIcon
类型:Microsoft.VisualStudio.Shell.Interop.OLEMSGICON
要显示的图标(警告、错误、信息性等)
返回值
类型:System.Windows.Forms.DialogResult
.NET Framework 安全性
- 对直接调用方的完全信任。此成员不能由部分信任的代码使用。有关详细信息,请参阅通过部分受信任的代码使用库。