zoukankan      html  css  js  c++  java
  • winform下richtextbox 特定字符颜色的改变

    winform下richtextbox 特定字符颜色的改变

    此程序特定字符为"(*)"

     private void richtextbox _TextChanged(object sender, EventArgs e)
            {
                string[] str = richtextbox .Text.Split(new string[] { "(*)" }, StringSplitOptions.RemoveEmptyEntries);
                int p2=0;
                for (int i = 0; i < str.Length;i++ )
                {
                    int p1 = Alisturl.Text.IndexOf("(*)",p2);
                    if (p1 != -1)
                    {
                        richtextbox.Select(p1, 3);
                        richtextbox.SelectionColor = Color.DarkGreen;
                        p2 = p1 + 3;
                    }
                }
                richtextbox.Refresh();
            }

  • 相关阅读:
    pycharm运行html文件报404错误
    css3 鼠标悬浮动画效果
    子代选择器和后代选择器的区别
    前端入门
    爬虫Scrapy框架
    BeautifulSoup
    爬虫之selenium使用
    爬虫之BeautifulSoup
    urllib模块
    爬虫基础
  • 原文地址:https://www.cnblogs.com/yeye518/p/2231618.html
Copyright © 2011-2022 走看看