0
Reply

Trouble changing textcolor

adb8sapa

adb8sapa

Jun 3 2004 2:49 PM
1.4k
Hello everyone. I´m using a richTextBox and are trying to color just a few pices of the text thats in it. I´ve done the following: int iPos = this.richTextBox1.TextLength; int iLength = "Listing stuff\n".Length; this.richTextBox1.Text += "Listing stuffs\n"; this.richTextBox1.Select(iPos, iLength); this.richTextBox1.SelectionColor = Color.Red; this.richTextBox1.SelectionLength = 0; The color changes to red, but when I add a new line to the richTextBox it all goes back to the way it was. What am I suppose to do? I appreciate any replys :) (I´m using Visual Studio .NET 2003)