• 大小: 45.85M
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-06-22
  • 语言: 其他
  • 标签: 其他  

资源简介

Showy.zip

资源截图

代码片段和文件信息

/*--------------------------------------------*
 *      @author: 望生帝
 *      @email:1842534199@qq.com
 *      @date: 2019/1/18
 *      @Remarks: 富文本的文本高亮
 *----------------------------------------------*/

using DevExpress.Utils.Extensions;
using DevExpress.XtraRichEdit.API.Native;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;

namespace Showy
{
    public partial class Form1 : DevExpress.XtraEditors.XtraForm
    {
        public Form1()
        {
            InitializeComponent();
            //richEditControl1.Text = ““;
        }

        private void Form1_Load(object sender EventArgs e)
        {
            string a = “string“;
            richEditControl1.Text = “11111111113333333333331111111122222222223333333333333222string“;
            List list = new List { “嗨“ “欧阳“ };
            Showy(richEditControl1 a);
            Showy(richEditControl1 list);

            memoEdit1.Text = “momoomoomomomomomomomomo“;
            MEShowy(memoEdit1 “11“);
            memoEdit1.Text += “89797“;

            richTextBox1.Text = “hi我是欧阳,s今天很嗨11122343321323146t362“;
            int start = 0;
            int end = richTextBox1.Text.Length;
            RTShowy(start end “今天“);
            richTextBox1.AppendText(“啦啦啦“);
            start = end;
            end = richTextBox1.Text.Length;
            RTShowy(start end “啦啦“);

            RTShowy(“欧阳“);

            RTShowy1(“你猜这次能不能成功“);
        }


        private void RTShowy1(string str)
        {
            int start = richTextBox1.Text.Length;
            int end = start + str.Length;
            richTextBox1.AppendText(str);//appendText 可以是格式不丢,但是只能给末尾添加 不能插入
            int index = richTextBox1.Find(str start end RichTextBoxFinds.None);
            richTextBox1.SelectionColor = Color.Red;
            index = richTextBox1.Find(str start end RichTextBoxFinds.None);
        }

        private void RTShowy(int start int end string str)
        {
            int index = richTextBox1.Find(str start end RichTextBoxFinds.None);
            richTextBox1.SelectionColor = Color.Red;
            index = richTextBox1.Find(str start end RichTextBoxFinds.None);
        }
        private void RTShowy(string item)
        {
            int start = 0;
            int end = this.richTextBox1.Text.Length;
            int index = richTextBox1.Find(item start end RichTextBoxFinds.None);
            while (index != -1)
            {
                richTextBox1.SelectionFont = new Font(richTextBox1.SelectionFont Fontstyle.Underline | Fontstyle.Bold);
                richTextBox1.SelectionColor = Color.Red;
                start = index + item.Length;
                index = richTextBox1.Find(item start end RichTextBoxFinds.None);
            }
        }


        private void MEShowy(DevExpress.XtraEditors.MemoEdit edit string str)
        

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2019-01-20 01:26  Showy\
     目录           0  2019-01-20 01:26  Showy\.vs\
     目录           0  2019-01-20 01:26  Showy\.vs\Showy\
     目录           0  2019-01-18 17:55  Showy\.vs\Showy\v14\
     文件       54272  2019-01-18 17:52  Showy\.vs\Showy\v14\.suo
     目录           0  2019-01-20 01:26  Showy\.vs\Showy\v15\
     文件       67584  2019-01-21 11:42  Showy\.vs\Showy\v15\.suo
     目录           0  2019-01-20 01:26  Showy\.vs\Showy\v15\Server\
     目录           0  2019-01-20 01:26  Showy\.vs\Showy\v15\Server\sqlite3\
     文件           0  2019-01-20 00:34  Showy\.vs\Showy\v15\Server\sqlite3\db.lock
     文件     3600384  2019-01-21 10:59  Showy\.vs\Showy\v15\Server\sqlite3\storage.ide
     文件       32768  2019-01-21 10:30  Showy\.vs\Showy\v15\Server\sqlite3\storage.ide-shm
     文件     4124152  2019-01-21 11:42  Showy\.vs\Showy\v15\Server\sqlite3\storage.ide-wal
     目录           0  2019-01-21 11:42  Showy\Showy\
     文件         982  2019-01-18 11:27  Showy\Showy.sln
     目录           0  2019-01-20 01:26  Showy\Showy\bin\
     目录           0  2019-01-20 01:26  Showy\Showy\bin\Debug\
     目录           0  2019-01-20 01:26  Showy\Showy\bin\Debug\de\
     文件    20278000  2018-12-06 21:27  Showy\Showy\bin\Debug\DevExpress.BonusSkins.v18.1.dll
     文件     6622960  2018-12-06 21:26  Showy\Showy\bin\Debug\DevExpress.Data.v18.1.dll
     文件     1448204  2018-12-06 21:27  Showy\Showy\bin\Debug\DevExpress.Data.v18.1.xml
     文件     4804848  2018-12-06 21:26  Showy\Showy\bin\Debug\DevExpress.Images.v18.1.dll
     文件     2308336  2018-12-06 21:27  Showy\Showy\bin\Debug\DevExpress.Office.v18.1.Core.dll
     文件      110033  2018-12-06 21:27  Showy\Showy\bin\Debug\DevExpress.Office.v18.1.Core.xml
     文件     2972400  2018-12-06 21:27  Showy\Showy\bin\Debug\DevExpress.Pdf.v18.1.Core.dll
     文件      367785  2018-12-06 21:27  Showy\Showy\bin\Debug\DevExpress.Pdf.v18.1.Core.xml
     文件     4286704  2018-12-06 21:27  Showy\Showy\bin\Debug\DevExpress.Printing.v18.1.Core.dll
     文件     1734268  2018-12-06 21:27  Showy\Showy\bin\Debug\DevExpress.Printing.v18.1.Core.xml
     文件     6642416  2018-12-06 21:28  Showy\Showy\bin\Debug\DevExpress.RichEdit.v18.1.Core.dll
     文件     2202543  2018-12-06 21:28  Showy\Showy\bin\Debug\DevExpress.RichEdit.v18.1.Core.xml
     文件       90352  2018-12-06 21:27  Showy\Showy\bin\Debug\DevExpress.Sparkline.v18.1.Core.dll
............此处省略111个文件信息

评论

共有 条评论