TreeView for WinForms | ComponentOne
C1.Framework Namespace / Style Class
Members

In This Topic
    Style Class
    In This Topic

    The Style class contains display attributes that determine the appearance of content on the screen/printer. It includes most elements found in Css styles.

    The Style class also contains methods for rendering and measuring content (strings and images) based on the style settings (fonts, margins, etc).

    The Style objects are not hierarchical in the sense that they don't have parent styles and don't inherit attributes from the parent style. To create a new style based on an existing one, you would clone the original style, then apply whatever attributes you want to the new style.

    The Style objects are hierarchical in the sense that two style attributes (Style.Font and Style.ForeBrush) don't need to be set. If these attributes are not set, they are inherited, but not from a parent Style object. Rather, these attributes are inherited from the parent UI object.

    This type of inheritance make it easy to define a font on a Style associated with a parent UI object and have that font be automatically applied to all UI objects contained in the parent. By contrast, a Style.BackBrush attribute is not explicitly inherited. Instead, the parent UI object paints its client area with a brush, and child UI objects have a transparent background by default, so the parent background shows through by default. Other attributes such as alignment, margins, padding, etc are also not inherited.

    Object Model
    Style ClassIBrushProvider InterfaceThickness StructureThickness StructureThickness StructureBorderEdges ClassThickness StructureCorners StructureStyle ClassStyle ClassStyle ClassStyle ClassThickness StructureThickness StructureThickness StructureThickness StructureStyle Class
    Syntax
    'Declaration
     
    
    <TypeConverterAttribute(System.ComponentModel.ExpandableObjectConverter)>
    Public Class Style 
    [TypeConverter(System.ComponentModel.ExpandableObjectConverter)]
    public class Style 
    Inheritance Hierarchy

    System.Object
       C1.Framework.Style

    See Also