我在richtextbox中只找到selectioncolor的属性
怎么能设置当前插入点的color属性?

解决方案 »

  1.   

    使用richtextbox
    private void button1_Click(object sender, System.EventArgs e)
    {
    string[] tempArray = new string [richTextBox1.Lines.Length];
    tempArray = richTextBox1.Lines; for(int counter=0; counter < tempArray.Length;counter++)
    {
    System.Diagnostics.Debug.WriteLine(tempArray[counter]);
    richTextBox1.SelectedText = tempArray[counter];
    if(counter%2==0)
    richTextBox1.SelectionColor = Color.Red;
    else
    richTextBox1.SelectionColor = Color.Green ;
    }
     


      }