This is a migrated thread and some comments may be shown as answers.

Apply style based on another spanbox

1 Answer 43 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Patrick
Top achievements
Rank 2
Patrick asked on 15 Feb 2013, 02:34 PM
Hi,

I'm trying to get the style of a spanbox by code and apply it to another spanbox. I'm confused on how to get the job done. Can I get a sample on how to do it?

Thanks a lot,

Pat

1 Answer, 1 is accepted

Sort by
0
Patrick
Top achievements
Rank 2
answered on 15 Feb 2013, 09:00 PM
Ok, I found how to do that. It could be faster if telerik documentation would be complete for all functions. Here is the snippet :
Spn = New Span
Spn.Text = "Text"
  
'NBM is a custom annotation. In my case, NBM.NextSibling is always a span.
Spn.CopyPropertiesFrom(DirectCast(NBM.NextSibling, Span)) 'CopyPropertiesFrom will copy all properties of NBM into spn.
editor.Document.InsertInline(Spn)
Tags
RichTextBox
Asked by
Patrick
Top achievements
Rank 2
Answers by
Patrick
Top achievements
Rank 2
Share this question
or