How to Use Styles > Applying Pictures to Grid Elements |
In earlier versions of True DBGrid, styles were used to specify font, color, and alignment attributes. Version 6.0 extends the concept of styles to include background and foreground pictures, enabling you to add adornments to headers, footers, and caption bars, specify a background pattern for data cells, and render picture data in cells without having to populate a ValueItems collection. The following properties of the Style object determine how pictures are displayed:
Sets/returns a style's background picture. |
|
Controls how a style's background picture is displayed. |
|
Sets/returns a style's foreground picture. |
|
Controls how a style's foreground picture is positioned. |
|
True if the foreground picture uses a transparent color. |
Since picture properties follow the same inheritance rules as other style attributes, any technique described earlier in this chapter also works with pictures. This means that you can attach pictures to a grid element using any of the following methods:
Setting the BackgroundPicture or ForegroundPicture property of a built-in named style at design time or run time.
Setting the BackgroundPicture or ForegroundPicture property of an anonymous style at design time or run time.
Calling the AddCellStyle or AddRegexCellStyle methods.
Writing a handler for the FetchCellStyle or FetchRowStyle events.