How do I maintain RichTextBox Fonts when manipulating the text?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Omer Geiger

    #1

    How do I maintain RichTextBox Fonts when manipulating the text?

    Hi,

    I have a rich text box named MyRichTB which has different types of fonts in it. I want to manipulate the text but maintain the fonts. for example:

    Code:
    int PromptLocation = ... ;
    string cmd = " ... ";
    MyRichTB.Text = MyRichTB.Text.Remove(PromptLocation);
    MyRichTB.AppendText(cmd);
    it seems that both commands Remove() and AppendText() change all the fonts to default.

    how can I maintain the original fonts?
  • Omer Geiger

    #2
    if this is of interest to anyone, i found a sollution:
    to use the methods Copy, Paste with the desired text selected.

    Comment

    Working...