List & Label .NET
combit.Reporting.Web.WebReportViewer Namespace / WebReportViewerController Class / OnPatchCSSForFormElements Method


In This Topic
    OnPatchCSSForFormElements Method
    In This Topic
    This virtual method can be overridden to inject custom CSS into the viewer space. The styles will be applied to the form elements of the specified type.
    Syntax
    'Declaration
     
    
    Public Overridable Function OnPatchCSSForFormElements() As List(Of String)
    public virtual List<string> OnPatchCSSForFormElements()
    public:
    virtual List<String^>^ OnPatchCSSForFormElements(); 

    Return Value

    List of string with one item per selector and CSS.
    Example
    ...
    public virtual List<string> OnPatchCSSForFormElements()
    {
        List<string> styles = new List<string>()
        {
            "textarea { color: blue; }", //Multi-Line Edit
            "input[type='edit'] { color: red; }", //Single-Line Edit
            "input[type='checkbox'] { accent-color: green; }", //Checkbox color when checked
            "select { color: violet; background-color: black; }", //Combobox
            "input[type='button'] { outline: 1px solid blue; }", //Button
        };
        return styles;
    }
    ...
    

     

    Requirements

    Platforms: Windows 10 (Version 21H2 - 22H2), Windows 11 (22H2 - 25H2), Windows Server 2016 - 2025
    .NET: .NET Framework 4.8, .NET 8, .NET 9, .NET 10

    See Also