Font font = new Font("Tahoma", 8, FontStyle.Regular);
richTextBox1.SelectionFont = font;
richTextBox1.SelectionColor = Color.Red;
richTextBox1.SelectedText = Environment.NewLine + textBox1.Text;
By using the above code, we can make a multiple colored texts in our richtextbox. This is basically used for doing some chat application. We will have to show the other end of person’s text in different color in chat application. So that we can use this method. And we can create a simple method and calling in every time of showing the text in richtextbox with the parameters of like “textbox1.text, color,..etc”.
For more visit my article in codeproject here with more explanation.
...S.VinothkumaR.
Hiç yorum yok:
Yorum Gönder