资源简介
windows form窗体控件编写的记事本,具有各种记事本的相关功能,例如查找,替换,打印,页面设置,保存等功能,以及常规的复制,黏贴功能。是学习windows form 窗体编程的基础实验

代码片段和文件信息
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace Text
{
public partial class Find : Form
{
Form1 f1 = new Form1();
public Find(Form1 fm)
{
f1 = fm;
InitializeComponent();
}
private void Find_Load(object sender EventArgs e)
{
radioButton2.Checked = true;
}
private void button1_Click(object sender EventArgs e)
{
if (radioButton2.Checked == true)
{
down(f1.richTextBox1 this.textBox1.Text checkBox1.Checked);
f1.richTextBox1.Focus();
}
else if (radioButton1.Checked == true)
{
up(f1.richTextBox1 this.textBox1.Text checkBox1.Checked);
f1.richTextBox1.Focus();
}
}
//向下查找
public void down(RichTextBox text string test bool check)
{
string strDown = ““;
int intCount = 0i=0;
if(check==false) //不区分大小写
{
if (text.SelectedText.ToUpper() == test.ToUpper()) //如果选中的文本等于需要替换的文本
{
//从光标所在位置后一位开始截取后面的所有字符
strDown = text.Text.Substring(text.Selectionstart + 1 text.Text.Length - (text.Selectionstart+1));
}
else
{
//从光标所在位置开始截取后面的所有字符
strDown = text.Text.Substring(text.Selectionstart text.Text.Length - text.Selectionstart);
}
}
else if (check == true) //区分大小写
{
if (text.SelectedText == test) //如果选中的文本等于需要替换的文本
{
//从光标所在位置后一位开始截取后面的所有字符
strDown = text.Text.Substring(text.Selectionstart + 1 text.Text.Length - (text.Selectionstart+1));
}
else
{
//从光标所在位置开始截取后面的所有字符
strDown = text.Text.Substring(text.Selectionstart text.Text.Length - text.Selectionstart);
}
}
intCount = text.Text.Length - strDown.Length; //存放除截取的字符数以外的字符数
// i + test.Length(要查找的字符的长度) 的长度不得大于截取字符数的长度
for (i = 0; i+test.Length <= strDown.Length ; i++)
{
if (check == true) //区分大小写
{
if (strDown.Substring(i test.Length) == test) //截取的字符等于要查找的字符
{
text.Selectionstart = i+intCount; //设置光标的起始位置
text.SelectionLength = test.Length; //设置文本的选定字符数
return;
}
}
els
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2017-03-06 23:53 Text\
文件 6793 2017-03-06 23:47 Text\QQ截图20170306234653.jpg
文件 21148 2017-03-06 23:53 Text\QQ截图20170是.jpg
目录 0 2017-03-06 23:52 Text\Text\
文件 6579 2017-03-06 23:00 Text\Text\Find.Designer.cs
文件 6656 2017-03-06 23:36 Text\Text\Find.cs
文件 7764 2017-03-06 22:58 Text\Text\Find.resx
文件 21221 2017-03-07 15:08 Text\Text\Form1.Designer.cs
文件 4609 2017-03-07 15:08 Text\Text\Form1.cs
文件 6825 2017-03-07 15:08 Text\Text\Form1.resx
文件 2903 2017-03-06 23:57 Text\Text\Info.Designer.cs
文件 469 2017-03-06 23:56 Text\Text\Info.cs
文件 6344 2017-03-06 23:56 Text\Text\Info.resx
文件 485 2017-03-01 11:06 Text\Text\Program.cs
目录 0 2017-03-06 21:17 Text\Text\Properties\
文件 1358 2017-03-01 10:01 Text\Text\Properties\AssemblyInfo.cs
文件 3685 2017-03-06 23:53 Text\Text\Properties\Resources.Designer.cs
文件 6769 2017-03-06 23:53 Text\Text\Properties\Resources.resx
文件 1089 2017-03-01 10:01 Text\Text\Properties\Settings.Designer.cs
文件 249 2017-03-01 10:01 Text\Text\Properties\Settings.settings
文件 6543 2017-03-06 23:32 Text\Text\Replace.Designer.cs
文件 7282 2017-03-06 23:45 Text\Text\Replace.cs
文件 7567 2017-03-06 23:32 Text\Text\Replace.resx
目录 0 2017-03-06 23:53 Text\Text\Resources\
文件 6793 2017-03-06 23:52 Text\Text\Resources\QQ截图20170306234653.jpg
文件 6793 2017-03-06 23:47 Text\Text\Resources\QQ截图201703062346531.jpg
文件 21148 2017-03-06 23:53 Text\Text\Resources\QQ截图20170是.jpg
文件 5186 2017-03-06 23:56 Text\Text\Text.csproj
文件 8916 2017-03-04 14:39 Text\Text\ZiTi.Designer.cs
文件 2769 2017-03-04 16:53 Text\Text\ZiTi.cs
文件 5817 2017-03-04 14:39 Text\Text\ZiTi.resx
............此处省略61个文件信息
相关资源
- Winform可视化打印模板设计工具含源码
- c# winform 自动登录 百度账户 源代码
- DirectX.Capturec# winform 操作摄像头录像附
- C# 五子棋程序 附带编程日记
- C# winform实现表数据导出到Excel表格
- C#四则运算Windows界面
- C# WinForm读写INI文件
- 用C#绘制正弦曲线,要用到Form1_Resiz
- C#更改Windows防火墙设置实例程序
- .NET C# Custom Form Designer (附源碼)
- C#处理png图片位深度和交错属性
- 101个微软的C#例子-Windows Forms篇
- winform(c#)最全73种非常漂亮界面样式
- winform与内嵌echarts的数据交互,让数据
- winform分页控件
- winform materialskin好看的皮肤组件
- winform 皮肤
- C#全套皮肤一共73款(IrisSkin4)
- UI界面皮肤(winform)
- winform开发的人脸识别打卡系统
- winform下拉多选自定义控件(带全选)
- winform控件库
- C# winform简洁漂亮的图形界面库SunnyU
- C# 斑马标签打印 (WEBamp;WINFORM)
- winform shell编程
- Xamarin forms 缩放手势
- winform实时获取网卡网速全部源码,获
- winform实现饼状图、柱状图、折线图(
- winform简单用户登录(带验证码)
- 输入框自动切换中文(C#winform)vs20
评论
共有 条评论