Language

CatalogPartChrome.CreateCatalogPartChromeStyle メソッド

定義

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

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

パラメーター

catalogPart
CatalogPart

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

chromeType
PartChromeType

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

返品

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

例外

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

chromeType は PartChromeTypeではありません。

例

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

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

注釈

CreateCatalogPartChromeStyle メソッドは、Style オブジェクトがCatalogPartChrome コントロールをレンダリングするために使用するCatalogPart オブジェクトを作成します。

注意 (継承者)

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

適用対象