ComponentOne List 8.0 for ActiveX
Applying cell styles by contents

You can tell True DBList to automatically apply colors and fonts to particular cells, based upon their displayed contents. To do so, you provide a pattern, called a regular expression, which the list tests against the displayed value of each cell. Using the AddRegexCellStyle method, you can associate a regular expression with a set of style attributes, then apply them to any possible combination of cell status values. The AddRegexCellStyle method is supported by the TDBList, TDBCombo, Split, and Column objects, allowing you to control the range of cells for which certain conditions apply.

The AddRegexCellStyle method requires an additional argument for the regular expression string. The following example uses a temporary style to display all cells in the first column that contain the string "Windows" in bold:

Example Title
Copy Code
Dim S As New TrueDBList80.Style

S.Font.Bold = True

TDBList1.Columns(0).AddRegexCellStyle dblAllCells, S, "Windows"

This feature allows you to implement "visual queries" that attach distinctive font or color attributes to cells that match a certain pattern.

 

 


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

Product Support Forum  |  Documentation Feedback