Language

EditorPartChrome.CreateEditorPartChromeStyle メソッド

定義

EditorPart オブジェクトによってレンダリングされる各EditorPartChrome コントロールのスタイル属性を提供するスタイル オブジェクトを作成します。

protected:
 virtual System::Web::UI::WebControls::Style ^ CreateEditorPartChromeStyle(System::Web::UI::WebControls::WebParts::EditorPart ^ editorPart, System::Web::UI::WebControls::WebParts::PartChromeType chromeType);
protected virtual System.Web.UI.WebControls.Style CreateEditorPartChromeStyle(System.Web.UI.WebControls.WebParts.EditorPart editorPart, System.Web.UI.WebControls.WebParts.PartChromeType chromeType);
abstract member CreateEditorPartChromeStyle : System.Web.UI.WebControls.WebParts.EditorPart * System.Web.UI.WebControls.WebParts.PartChromeType -> System.Web.UI.WebControls.Style
override this.CreateEditorPartChromeStyle : System.Web.UI.WebControls.WebParts.EditorPart * System.Web.UI.WebControls.WebParts.PartChromeType -> System.Web.UI.WebControls.Style
Protected Overridable Function CreateEditorPartChromeStyle (editorPart As EditorPart, chromeType As PartChromeType) As Style

パラメーター

editorPart
EditorPart

現在レンダリングされているコントロール。

chromeType
PartChromeType

特定のコントロールのクロムの種類。 PartChromeType 列挙値のいずれか。

返品

Styleのスタイル属性を含むeditorPart。

例外

editorPart参照するコントロールはnull。

chromeType は PartChromeTypeではありません。

例

次のコード例では、 CreateEditorPartChromeStyle メソッドをオーバーライドして、エディター パーツ コントロールの背景色を変更する方法を示します。 これらのコントロールをホストするための Web ページなど、例を実行するために必要な完全なコードについては、 EditorPartChrome クラスの概要の「例」セクションを参照してください。

protected override Style CreateEditorPartChromeStyle(EditorPart editorPart, PartChromeType chromeType)
{
    Style editorStyle = base.CreateEditorPartChromeStyle(editorPart, chromeType);
    editorStyle.BackColor = Color.Bisque;
    return editorStyle;
}
Protected Overrides Function CreateEditorPartChromeStyle(ByVal editorPart As System.Web.UI.WebControls.WebParts.EditorPart, ByVal chromeType As System.Web.UI.WebControls.WebParts.PartChromeType) As System.Web.UI.WebControls.Style
    Dim editorStyle As Style
    editorStyle = MyBase.CreateEditorPartChromeStyle(editorPart, chromeType)
    editorStyle.BackColor = Drawing.Color.Bisque
    Return editorStyle
End Function

注釈

CreateEditorPartChromeStyle メソッドは、Style コントロールをレンダリングするためにEditorPartChrome オブジェクトによって使用されるEditorPart オブジェクトを作成します。

注意 (継承者)

EditorPartChrome クラスから継承する場合は、必要に応じて、CreateEditorPartChromeStyle(EditorPart, PartChromeType) メソッドをオーバーライドし、基本メソッドのスタイル情報を追加するカスタム スタイル属性とマージできます。 デモについては、「例」セクションを参照してください。

適用対象