指定したエラー メッセージをメッセージ ボックスに表示します。
オーバーロードの一覧
指定した例外および例外に関する情報をメッセージ ボックスに表示します。
[Visual Basic] Overloads Sub ShowError(Exception)
[JScript] function ShowError(Exception);
指定したエラー メッセージをメッセージ ボックスに表示します。
[Visual Basic] Overloads Sub ShowError(String)
[C++] void ShowError(String*);
[JScript] function ShowError(String);
指定した例外および例外に関する情報をメッセージ ボックスに表示します。
[Visual Basic] Overloads Sub ShowError(Exception, String)
[JScript] function ShowError(Exception, String);
使用例
[Visual Basic, C#, C++] IUIService のインスタンスを取得し、サービスの ShowError メソッドを呼び出すコード例を次に示します。
[Visual Basic, C#, C++] メモ ここでは、ShowError のオーバーロード形式のうちの 1 つだけについて、使用例を示します。その他の例については、各オーバーロード形式のトピックを参照してください。
Dim UIservice As IUIService = CType(Me.GetService( _
GetType(System.Windows.Forms.Design.IUIService)), IUIService)
If Not (UIservice Is Nothing) Then
UIservice.ShowError(New Exception( _
"This is a message in a test exception, displayed by the IUIService", _
New ArgumentException("Test inner exception")))
End If
[C#]
IUIService UIservice = (IUIService)this.GetService(
typeof( System.Windows.Forms.Design.IUIService ) );
if( UIservice != null )
UIservice.ShowError( new Exception(
"This is a message in a test exception, " +
"displayed by the IUIService",
new ArgumentException("Test inner exception")));
[C++]
IUIService* UIservice = dynamic_cast<IUIService*>(this->GetService(__typeof(System::Windows::Forms::Design::IUIService)));
if (UIservice != 0)
UIservice->ShowError(new Exception(S"This is a message in a test exception, displayed by the IUIService", new ArgumentException(S"Test inner exception")));
[JScript] JScript のサンプルはありません。Visual Basic、C#、および C++ のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン をクリックします。
参照
IUIService インターフェイス | IUIService メンバ | System.Windows.Forms.Design 名前空間