Skype:TextControlSupport
Orders:877-462-4772
TX Text Control - word processing components.
« »

Copy all styles from one TextControl into another

Blogged by Björn Meyer on May 31, 2007 and tagged with Samples, .NET.

Sometimes, it is required to copy all styles of the InlineStyles or ParagraphStyles collection to another instance of TextControl without cloning the whole text.

In this case, you can simply use a foreach loop to iterate through all styles. In this loop, you need to create a new instance of the style object that can be added to the style collection of the second TX Text Control.

The following code copies all InlineStyles from textControl1 to the second instance textControl2:

foreach (TXTextControl.InlineStyle curStyle in textControl1.InlineStyles)
{
TXTextControl.InlineStyle newStyle = new TXTextControl.InlineStyle(curStyle);
textControl2.InlineStyles.Add(newStyle);
}
« Prev:TX Text Control .NET Licensing
» Next:Apply a boxed frame style to selected cells

Comments

If you would like to comment on this blog entry, please post a comment.

External verification page for ISO 9000:2000 certificate
ISO 9001:2000
certified