StyledText.InsertStyleRun

From Xojo Documentation

Method

StyledText.InsertStyleRun(Run as StyleRun,Index as Integer)

Supported for all project types and targets.

Inserts the StyleRun passed at the insertion point designated by Index.

Notes

Index is zero-based. You can get the total number of StyleRuns in Text from the StyleRunCount method.

Example

This example appends a StyleRun into a TextArea and then inserts another one in an earlier position.

TextArea2.StyledText.AppendStyleRun(textarea1.Styledtext.StyleRun(1))
TextArea2.StyledText.InsertStyleRun(TextArea1.StyledText.Stylerun(0), 1)