MenuDesigner.GetErrorDesignTimeHtml メソッド
アセンブリ: System.Design (system.design.dll 内)
構文Dim e As Exception Dim returnValue As String returnValue = Me.GetErrorDesignTimeHtml(e)
戻り値
エラーが発生した後で、関連付けられた Menu のデザイン時表示に使用するマークアップを含んだ文字列。
解説GetErrorDesignTimeHtml メソッドは、デザイン時の Menu コントロールに、型名、コントロール名、およびエラーを説明するメッセージを含んだプレースホルダとしてエラーを表示するマークアップを生成します。
使用例MenuDesigner クラスから継承したクラスの GetErrorDesignTimeHtml メソッドをオーバーライドする方法を次のコード例に示します。オーバーライドされたメソッドは、デザイン時に Menu クラスから派生したコントロールの外観を変更します。この例では、赤の太字で表示されるエラー メッセージを含んだプレースホルダのマークアップを生成しています。
' Generate the design-time markup for the control when an error occurs. Protected Overrides Function GetErrorDesignTimeHtml( _ ByVal ex As Exception) As String ' Write the error message text in red, bold. Dim errorRendering As String = _ "<span style=""font-weight:bold; color:Red; "">" & _ ex.Message & "</span>" Return CreatePlaceHolderDesignTimeHtml(errorRendering) End Function ' GetErrorDesignTimeHtml
// Generate the design-time markup for the control when an error occurs. protected override string GetErrorDesignTimeHtml(Exception ex) { // Write the error message text in red, bold. string errorRendering = "<span style=\"font-weight:bold; color:Red; \">" + ex.Message + "</span>"; return CreatePlaceHolderDesignTimeHtml(errorRendering); } // GetErrorDesignTimeHtml
.NET Framework のセキュリティ
プラットフォームWindows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。
バージョン情報
参照Weblioに収録されているすべての辞書からMenuDesigner.GetErrorDesignTimeHtml メソッドを検索する場合は、下記のリンクをクリックしてください。
全ての辞書からMenuDesigner.GetErrorDesignTimeHtml メソッド
を検索
- MenuDesigner.GetErrorDesignTimeHtml メソッドのページへのリンク