📄 form4.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 + -