TX Text Control .NET for Windows Forms offers extensive classes to modify document styles. The FormattingStyle class is the base class for the two different supported style classes: InlineStyle and ParagraphStyle. These classes can be used to change the styles.

TX Text Control ActiveX offers a Style object that represents a formatting style. The Styles collection represents all formatting styles a TX Text Control document contains. A common task is to access an existing style and to change some attributes.

Consider a style with the name Headline. To modify this style, the Item method must be called with the name of the style. After that, the properties of the Style object can be modified. Then, the modifications and the Apply method must be used to confirm the changes. The following sample code shows this in detail.

Set style = TXTextControl1.Styles.Item("Headline")
style.FontName = "Arial"
style.FontSize = 400
style.Apply