I have Rich Textbox and it’s named textBox1
When I try this:
textBox1.AppendText(value);
textBox1.SelectionColor = Color.Red;
the Red is underlined and errored:
Error 2 'string' does not contain a definition for 'Red' and no extension method 'Red' accepting a first argument of type 'string' could be found (are you missing a using directive or an assembly reference?) Form1.cs 73 57
Does your form have a field or property named
Colorwhose type isstring? If it does, then the “Color” inColor.Redrefers to that field or property instead of theSystem.Drawing.Colortype.You can disambiguate the reference by specifying the
System.Drawingnamespace: