相关疑难解决方法(0)

RichTextBox颜色选中的行

我是Windows Forms的新手.我正在使用VS 2008,C#编写RichTextBox.我想在写入RichTextBox时能够用不同的颜色为每一行着色.有人可以指点我的样品.谢谢

foreach (string file in myfiles)
{
  // As I process my files
  // richTextBox1.Text += "My processing results";
  if(file == "somefileName")
  {
    // Color above entered line or enter new colored line
  }

}
Run Code Online (Sandbox Code Playgroud)

.net c# richtextbox winforms

9
推荐指数
1
解决办法
2万
查看次数

标签 统计

.net ×1

c# ×1

richtextbox ×1

winforms ×1