CatalogPartChrome.CreateCatalogPartChromeStyle(CatalogPart, PartChromeType) Método

Definição

Cria o objeto de estilo que fornece os atributos de estilo para cada controle de CatalogPart renderizado pelo objeto de CatalogPartChrome.Creates the style object that supplies style attributes for each CatalogPart control rendered by the CatalogPartChrome object.

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

Parâmetros

catalogPart
CatalogPart

O controle que está sendo renderizado no momento.The control that is currently being rendered.

chromeType
PartChromeType

O tipo de cromado para um determinado controle. Um dos valores de enumeração PartChromeType.The type of chrome for a particular control; one of the PartChromeType enumeration values.

Retornos

Style

Um Style que contém atributos de estilo para catalogPart.A Style that contains style attributes for catalogPart.

Exceções

O controle ao qual o catalogPart se refere é null.The control that catalogPart refers to is null.

chromeType não é um PartChromeType.chromeType is not a PartChromeType.

Exemplos

O exemplo de código a seguir demonstra como substituir o CreateCatalogPartChromeStyle método para alterar a cor do plano de fundo do controle da parte do catálogo.The following code example demonstrates how to override the CreateCatalogPartChromeStyle method to change the background color of the catalog part control. Para o código completo necessário para executar o exemplo, incluindo a página da Web para hospedar esses controles, consulte a seção de exemplo da CatalogPartChrome classe visão geral.For the full code required to run the example, including the Web page to host these controls, see the Example section of the CatalogPartChrome class overview.

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

Comentários

O CreateCatalogPartChromeStyle método cria um Style objeto que é usado pelo CatalogPartChrome objeto para renderizar um CatalogPart controle.The CreateCatalogPartChromeStyle method creates a Style object that is used by the CatalogPartChrome object to render a CatalogPart control.

Notas aos Herdeiros

Se você herdar da CatalogPartChrome classe, você pode opcionalmente substituir o CreateCatalogPartChromeStyle(CatalogPart, PartChromeType) método e mesclar as informações de estilo do método base com atributos de estilo personalizados que você deseja adicionar.If you inherit from the CatalogPartChrome class, you can optionally override the CreateCatalogPartChromeStyle(CatalogPart, PartChromeType) method, and merge the style information from the base method with custom style attributes that you want to add. Para ver uma demonstração, consulte a seção de exemplo.For a demonstration, see the Example section.

Aplica-se a