ComponentOne List 8.0 for ActiveX
Modifying a style property directly

You can customize the appearance of a list component by modifying one or more members of an appropriate style property. For example, to make the list's caption text bold, you can change the Font object associated with the CaptionStyle property. At design time, this is done by expanding the CaptionStyle tree node on the General property page, selecting the Font node, and checking the Bold box. The change is committed to the list when you click the OK or Apply button or select a different property page tab.

Note that the text of the CaptionStyle node ends with the word Caption enclosed in square brackets. This indicates that the property inherits some or all of its attributes from a like-named member of the Styles collection. However, if you switch to the Style Factory property page, you will see that the built-in Caption style has not changed.

This means that the following statements are not equivalent:

Example Title
Copy Code
TDBList1.CaptionStyle.Font.Bold = True

TDBList1.Styles("Caption").Font.Bold = True

The first statement specializes the font of the list's caption bar without changing the named Caption style. The second statement changes the named Caption style, which may or may not affect the display of the list's caption bar, depending on whether the Font member of the CaptionStyle property was specialized previously. For example, if you change the list's CaptionStyle font to Arial, then change the font of the built-in Caption style to Courier, the list caption will remain Arial. However, if you never change the CaptionStyle font, then any font change to the built-in Caption style will be instantly reflected in the list's caption bar.

 

 


Copyright (c) GrapeCity, inc. All rights reserved.

Product Support Forum  |  Documentation Feedback