EditorPartChrome.CreateEditorPartChromeStyle Method (EditorPart, PartChromeType)
Creates the style object that supplies style attributes for each EditorPart control rendered by the EditorPartChrome object.
Assembly: System.Web (in System.Web.dll)
Protected Overridable Function CreateEditorPartChromeStyle ( editorPart As EditorPart, chromeType As PartChromeType ) As Style
Parameters
- editorPart
-
Type:
System.Web.UI.WebControls.WebParts.EditorPart
The control that is currently being rendered.
- chromeType
-
Type:
System.Web.UI.WebControls.WebParts.PartChromeType
The type of chrome for a particular control; one of the PartChromeType enumeration values.
Return Value
Type: System.Web.UI.WebControls.StyleA Style that contains style attributes for editorPart.
| Exception | Condition |
|---|---|
| ArgumentNullException | The control that editorPart refers to is null. |
| ArgumentOutOfRangeException | chromeType is not a PartChromeType. |
The CreateEditorPartChromeStyle method creates a Style object that is used by the EditorPartChrome object to render an EditorPart control.
Notes to Implementers:
If you inherit from the EditorPartChrome class, you can optionally override the CreateEditorPartChromeStyle method, and merge the style information from the base method with custom style attributes that you want to add. For a demonstration, see the Example section.
The following code example demonstrates how to override the CreateEditorPartChromeStyle method to change the background color of the editor part control. For the full code required to run the example, including the Web page to host these controls, see the Example section of the EditorPartChrome class overview.
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
Available since 2.0