Reports for WinForms | ComponentOne
Working with C1PrintDocument / Styles / Sub-Properties of Complex Style Properties
In This Topic
    Sub-Properties of Complex Style Properties
    In This Topic

    Some of the properties in the table in the Style Properties and Their Default Values topic contain sub-properties which can be individually set. For instance, the BackgroundImageAlign property has AlignHorz, AlignVert, and several other sub-properties. With the exception of read-only sub-properties (as is the case with fonts, which are immutable and whose individual sub-properties cannot be set), each sub-property can be set or inherited individually.

    While the sub-properties of a font can not be modified, each of those sub-properties is represented by a separate root level property on a style - FontBold, FontItalic, and so on. Each of those properties can be set individually, and follows the general style inheritance rules. There is a nuance though that must be taken into consideration: if both Font and one of the separate font-related properties (FontBold, FontItalic, and so on.) are set, the result depends on the order in which the two properties are set. If the Font is set first, and then a font-related property is modified (that is, FontItalic is set to True), that modification affects the result. If, on the other hand, FontItalic is set to True first, and then Font is assigned to a non-italic font, the change to FontItalic is lost.