RichTextBox formatation transter

  • Thread starter Thread starter cardososp
  • Start date Start date
C

cardososp

How can i transfer formatted data to another RichTextBox ?



I try


richTextBox1.Lines = richTextBox2.lines;
richTextBox1.Text = richTextBox2.Text;

it don't work..
 
More information..

richTextBox1.AppendText("[" + DateTime.Now.ToShortTimeString() + "]"+UserName+" >>" , Color.Green);
richTextBox1.AppendText(" ");
richTextBox1.AppendText(message + Environment.NewLine, Color.Blue);



Code:
public static class RichTextBoxExtensions
{
public static void AppendText(this RichTextBox box, string text, Color color)
{
box.SelectionStart = box.TextLength;
box.SelectionLength = 0;

box.SelectionColor = color;
box.AppendText(text);
box.SelectionColor = box.ForeColor;
}
}
 
Jeff Johnson said:
How can i transfer formatted data to another RichTextBox ?

Try the RtfText (or is it TextRtf?) property.[/QUOTE]


Argh, it's just Rtf.
 
Back
Top