⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 form4.cs

📁 简易文本编辑器 便于书写 适合初学者参考 也可进一步改进
💻 CS
字号:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace WindowsApplication1
{
    public partial class Form4 : Form
    {
        public Form4()
        {
            InitializeComponent();
        }
        public RichTextBox s1;
        public int start;
        private void button1_Click(object sender, EventArgs e)
        {
            string str1;
            str1 = textBox1.Text;
            if (str1 == "")
            {
                MessageBox.Show("请确认查找内容!", "异常警示");
            }
            else
            {
                start = s1.Find(str1, start, RichTextBoxFinds.MatchCase);
                if (start == -1)
                {
                    MessageBox.Show("已经查到文档的结尾!", "结束查找");
                    start = 0;
                    s1.Focus();

                }
                else
                {
                    start = start + str1.Length;
                    s1.Focus();
                }
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void Form4_Load(object sender, EventArgs e)
        {

        }
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -