ComponentOne List for WinForms
In This Topic
    Example 1 - Inheriting from Containing Splits
    In This Topic

    Since the default values of all built-in styles are in effect, columns inherit from their containing splits, which in turn inherit from the list as a whole. Therefore, this statement affects not only data cells, but all headers, footers, and caption bars. This statement has the same visual effect as changing the Normal style directly using the Style Collection Editor; however, the built-in Normal style itself is not changed.

    The following code inherits values from the containing splits:

    To write code in Visual Basic

    Visual Basic
    Copy Code
    Dim myfont As Font        
    myfont = New Font(Me.C1List1.Styles("Normal").Font, FontStyle.Bold)        
    Me.C1List1.Styles("Normal").Font = myfont
    

    To write code in C#

    C#
    Copy Code
    Font myfont;        
    myfont = new Font(this.c1List1.Styles["Normal"].Font, FontStyle.Bold);        
    this.c1List1.Styles["Normal"].Font = myfont;