TPlusMemo.SetDynStyle
PlusMemo Help Send comments on this topic.
TPlusMemo.SetDynStyle method

Glossary Item Box

 

Applies to

TPlusMemo, TDBPlusMemo

 

Declaration

procedure SetDynStyle(Start, Stop: Longint; 

                      Style: TFontStyles;

                      ContentDependant: Boolean; 

                      Context: Smallint;

                      Cursor : TCursor;

                      Backgnd, Foregnd: TColor;

                      Collapsible: Boolean);

 

Description

The SetDynStyle method is used to apply dynamic styling to part of the text.  The formatting information is not embedded in the text, nor is it saved in a stream or copied to the clipboard.

 

Parameters Start and Stop specifiy the text range.  Style specifies the font style to apply to that range.  ContentDependant controls whether the applied style is permanent or not.  If False, the text between Start and Stop will be permanently marked with the style specified.  If True, whenever the text between Start and Stop changes, this style specification will be removed and the OnParse event handler will receive all the text between Start and Stop that has been uncovered by this removal.

 

Context is the value that will be passed to the OnContext event whenever the user clicks with the mouse on the text between Start and Stop.  If Context is specified as zero, no OnContext event will occur for this text range.

 

Cursor determines the shape of the cursor when the user moves the mouse over the text range.  The value crDefault means to use the default cursor shape for the control that is specified by its own property Cursor.

 

Backgnd and Foregnd  specify respectively the background color and text color of the range.  If both of them are set to 0 no color change will occur; the colors of the section will be those of the properties Color and Font.Color of the TPlusMemo.  Also, a value of clNone can be used to keep the background or foreground color of regular unhighlighted text.

 

Parameter Collapsible determines if the section of text between Start and Stop can be collapsed.  See topic Collapsible blocks for further information.