小弟遇到一个问题请各位大虾帮忙,怎样在textBox控制显示出来的文字,一行是红色,一行是黑色,一行是蓝色,当用它本身的ForeColor,所有的字只有一种颜色。谢谢,给分2000

解决方案 »

  1.   

    使用一个开源的控件Freetextbox
    FreeTextBox 3.0 is a free ASP.NET server control written in C# for use in ASP.NET applications. You can use FreeTextBox in any product with no obligation for payment. FreeTextBox version 3.0 has many new free features (such as an integrated image gallery) as well as some features (such as form, table and style editing: feature list) that can be unlocked via a license file. A "Pro" license may be purchased by a development team and used in all their projects, but may not be re-distributed in secondary applications. The source code is also available for custom implementations.下载地址为:
    http://www.freetextbox.com/
      

  2.   

    this.richTextBox1.Select(0,this.richTextBox1.Lines[0].Length);
    this.richTextBox1.SelectionColor=System.Drawing.Color.Aqua;
      

  3.   

    用richtextbox代替,或者干脆用第三方控件好了.
      

  4.   

    直接使用TextBox是实现不了的,还是考虑使用RichTextBox吧。
      

  5.   

    Freetextbox
    http://www.freetextbox.com/