• 大小: 0.25M
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2024-04-24
  • 语言: C#
  • 标签: C#  记事本  查找功能  

资源简介

C#简易记事本功能齐全,字数统计、时长统计、查找功能......

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApplication3
{
    public partial class find : Form
    {
        public int start;
        Form2 f1;
        public find()
        {
            InitializeComponent();
        }

        private void find_Load(object sender EventArgs e)
        {
            start = 0;
            f1 = (Form2)this.Owner;

        }
        
        private void button1_Click(object sender EventArgs e)
        {
            if (radioButton1.Checked == true)     //如果向下找
            {
                if (checkBox1.Checked)              //如果区分大小写
                    start = f1.richTextBox1.Find(textBox1.Text start RichTextBoxFinds.MatchCase);
                else
                    start = f1.richTextBox1.Find(textBox1.Text start RichTextBoxFinds.None);
                if (start == -1)                    //如果返回值是-1,表示没找到
                {
                    MessageBox.Show(“已查找到文档的结尾“ “查找结束对话框“);
                    start = 0;
                }
                else                                                                               //查找到
                {
                    start = start + textBox1.Text.Length;//设置下一查找位置wl
                    if (start >= f1.richTextBox1.Text.Length)
                    {
                        MessageBox.Show(“已查找到文档的结尾“ “查找结束对话框“);
                        start = 0;
                    }
                }
            }

            if (radioButton2.Checked == true)          //如果向上找
            {
                if (checkBox1.Checked)
                    start = f1.richTextBox1.Find(textBox1.Text 0 start RichTextBoxFinds.MatchCase | RichTextBoxFinds.Reverse);
                else
                    start = f1.richTextBox1.Find(textBox1.Text 0 start RichTextBoxFinds.Reverse);
                if (start == -1 || start == 0)             //如果返回值是-1,表示没找到
                {
                    MessageBox.Show(“已查找到文档的开头“ “查找结束对话框“);
                    start = f1.richTextBox1.Text.Length;
                }
            }

        }

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

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件        189  2020-12-24 18:30  WindowsFormsApplication3\App.config

     文件      70656  2020-12-28 19:17  WindowsFormsApplication3\bin\Debug\WindowsFormsApplication3.exe

     文件        189  2020-12-24 18:30  WindowsFormsApplication3\bin\Debug\WindowsFormsApplication3.exe.config

     文件      52736  2020-12-28 19:17  WindowsFormsApplication3\bin\Debug\WindowsFormsApplication3.pdb

     文件      22696  2020-12-28 19:24  WindowsFormsApplication3\bin\Debug\WindowsFormsApplication3.vshost.exe

     文件        189  2020-12-24 18:30  WindowsFormsApplication3\bin\Debug\WindowsFormsApplication3.vshost.exe.config

     文件        490  2015-06-04 12:48  WindowsFormsApplication3\bin\Debug\WindowsFormsApplication3.vshost.exe.manifest

     文件       1101  2020-12-27 15:59  WindowsFormsApplication3\CommandMode\ComboboxIndexChangedCommand.cs

     文件        264  2020-12-27 15:59  WindowsFormsApplication3\CommandMode\Command.cs

     文件        940  2020-12-27 16:11  WindowsFormsApplication3\CommandMode\TextChangedCommand.cs

     文件       2634  2020-12-28 19:11  WindowsFormsApplication3\find.cs

     文件       6752  2020-12-28 19:11  WindowsFormsApplication3\find.Designer.cs

     文件       5817  2020-12-28 19:11  WindowsFormsApplication3\find.resx

     文件       4880  2020-12-28 17:01  WindowsFormsApplication3\Form1.cs

     文件       6582  2020-12-28 17:01  WindowsFormsApplication3\Form1.Designer.cs

     文件      70236  2020-12-27 16:31  WindowsFormsApplication3\Form1.resx

     文件       7765  2020-12-28 19:17  WindowsFormsApplication3\Form2.cs

     文件      24640  2020-12-28 19:17  WindowsFormsApplication3\Form2.Designer.cs

     文件       7219  2020-12-28 19:17  WindowsFormsApplication3\Form2.resx

     文件       1464  2020-12-25 15:55  WindowsFormsApplication3\obj\Debug\DesignTimeResolveAssemblyReferences.cache

     文件       7442  2020-12-28 17:01  WindowsFormsApplication3\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache

     文件          0  2020-12-24 18:30  WindowsFormsApplication3\obj\Debug\TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs

     文件          0  2020-12-24 18:30  WindowsFormsApplication3\obj\Debug\TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs

     文件          0  2020-12-24 18:30  WindowsFormsApplication3\obj\Debug\TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs

     文件       1789  2020-12-28 19:24  WindowsFormsApplication3\obj\Debug\WindowsFormsApplication3.csproj.FileListAbsolute.txt

     文件       1186  2020-12-28 19:17  WindowsFormsApplication3\obj\Debug\WindowsFormsApplication3.csproj.GenerateResource.Cache

     文件       2384  2020-12-24 18:43  WindowsFormsApplication3\obj\Debug\WindowsFormsApplication3.csprojResolveAssemblyReference.cache

     文件      70656  2020-12-28 19:17  WindowsFormsApplication3\obj\Debug\WindowsFormsApplication3.exe

     文件        180  2020-12-28 19:11  WindowsFormsApplication3\obj\Debug\WindowsFormsApplication3.find.resources

     文件      43231  2020-12-28 17:01  WindowsFormsApplication3\obj\Debug\WindowsFormsApplication3.Form1.resources

............此处省略23个文件信息

评论

共有 条评论