• RichText设置高亮 (未完)


      //RichText添加选区 颜色
    private void ChangeColor(string text, Color color)
    {
    //int s = 0;
    //while ((-1 + text.Length - 1) != (s = text.Length - 1 + this.txtResult.Find(text, s, -1, RichTextBoxFinds.MatchCase | RichTextBoxFinds.WholeWord)))
    //{
    // this.txtResult.SelectionColor = color;
    //}
    int s = 0;
    //并上 RichTextBoxFinds.WholeWord 就没结果
    while (this.txtResult.Find(text, s, RichTextBoxFinds.MatchCase) > -1)
    {
    s
    = this.txtResult.Find(text, s, RichTextBoxFinds.MatchCase);
    this.txtResult.Select(s, text.Length);
    this.txtResult.SelectionColor = color;
    s
    ++;
    }

    }

  • 相关阅读:
    二分查找
    二分排序
    How to use hdu?
    HGOI 20200721
    HGOI 20200720
    HGOI 20190719
    HGOI 20200716
    HGOI 20190714
    LCA 的一些扩展算法
    HGOI 20190711
  • 原文地址:https://www.cnblogs.com/shikyoh/p/2182305.html
Copyright © 2020-2023  润新知