The DBRichEdit component is a data-aware control that can display formatted text stored in BLOB fields. Rich Text describes text fields that support the formatting of individual characters, words, and paragraphs. Text searching and printing functions are supported by Rich Text controls and by default they support the following types of formatting:
Font attributes such as typeface, size, color, etc.
Text alignment, tabs, indentation, and list numbering
DBRichEdit supports these formatting capabilities but does not provide any interface elements to implement them. Your application will have to support these functions separate from the control.
One other aspect of this control is important to realize when implementing it in an application. DBRichEdit will automatically place the dataset object into the Edit state when the text is changed within the control. If only the formatting of the text displayed by the control is modified, the application must programmatically put the dataset into Edit for the changes to be saved; this is an important distinction between the text and the formatting that should be remembered.
DBRichEdit surfaces a number of properties, some that are very familiar and others focused on the unique tasks of this component.
The Alignment property affects the justification of the text contained with the control. The standard choices are offered: Left-Justified., Right-justified, and Centered.
AutoDisplay serves the same purpose in this control as it does in the other BLOB-related components. By default, the contents of the BLOB field will be automatically displayed as the user scrolls through the database. If the size of the BLOB fields becomes an impediment to good performance, turn off the automatic display through this property
The HideScrollBars property is used to control the automatic display of scroll bars in the DBRichEdit component. If the property is set to True and the entire contents of the text fit within the edit window, the scroll bars are unnecessary and disappear from the control. They will return again, if modifications to the text make it exceed the size of the edit window.
When a user is editing a large block of text and the contents are prone to condense or enlarge below or beyond the size of the edit window,
I 84 ■ fart II-The Delphi Database Tools they may become annoyed at the flashing of the scroll bars. If this is the case, you might want to consider setting this property to False.
Was this article helpful?