亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? searchandreplace.cs

?? 一個簡單的文本編輯器程序,功能和windows記事本類似
?? CS
字號:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;

namespace Editor
{
	/// <summary>
	/// SearchAndReplace 的摘要說明。
	/// </summary>
	public class SearchAndReplace : System.Windows.Forms.Form
	{
		private System.Windows.Forms.Label label1;
		private System.Windows.Forms.TextBox txtSearch;
		private System.Windows.Forms.RadioButton radioUp;
		private System.Windows.Forms.RadioButton radioDown;
		private System.Windows.Forms.CheckBox checkCase;
		private System.Windows.Forms.Label label2;
		private System.Windows.Forms.Button btnSearch;
		private System.Windows.Forms.Button btnReplace;
		private System.Windows.Forms.Button btnReplaceAll;
		private System.Windows.Forms.TextBox txtReplace;
		/// <summary>
		/// 必需的設計器變量。
		/// </summary>
		private System.ComponentModel.Container components = null;
		private MainForm parentForm;

		public SearchAndReplace(MainForm parent)
		{
			//
			// Windows 窗體設計器支持所必需的
			//
			InitializeComponent();

			this.parentForm = parent;

			//
			// TODO: 在 InitializeComponent 調用后添加任何構造函數代碼
			//
		}

		/// <summary>
		/// 清理所有正在使用的資源。
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if(components != null)
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Windows 窗體設計器生成的代碼
		/// <summary>
		/// 設計器支持所需的方法 - 不要使用代碼編輯器修改
		/// 此方法的內容。
		/// </summary>
		private void InitializeComponent()
		{
			this.label1 = new System.Windows.Forms.Label();
			this.txtSearch = new System.Windows.Forms.TextBox();
			this.radioUp = new System.Windows.Forms.RadioButton();
			this.radioDown = new System.Windows.Forms.RadioButton();
			this.checkCase = new System.Windows.Forms.CheckBox();
			this.label2 = new System.Windows.Forms.Label();
			this.txtReplace = new System.Windows.Forms.TextBox();
			this.btnSearch = new System.Windows.Forms.Button();
			this.btnReplace = new System.Windows.Forms.Button();
			this.btnReplaceAll = new System.Windows.Forms.Button();
			this.SuspendLayout();
			// 
			// label1
			// 
			this.label1.Location = new System.Drawing.Point(16, 16);
			this.label1.Name = "label1";
			this.label1.Size = new System.Drawing.Size(56, 16);
			this.label1.TabIndex = 0;
			this.label1.Text = "查找內容";
			// 
			// txtSearch
			// 
			this.txtSearch.Location = new System.Drawing.Point(80, 8);
			this.txtSearch.Name = "txtSearch";
			this.txtSearch.Size = new System.Drawing.Size(160, 21);
			this.txtSearch.TabIndex = 1;
			this.txtSearch.Text = "";
			// 
			// radioUp
			// 
			this.radioUp.Location = new System.Drawing.Point(120, 72);
			this.radioUp.Name = "radioUp";
			this.radioUp.Size = new System.Drawing.Size(48, 24);
			this.radioUp.TabIndex = 2;
			this.radioUp.Text = "向上";
			// 
			// radioDown
			// 
			this.radioDown.Checked = true;
			this.radioDown.Location = new System.Drawing.Point(192, 72);
			this.radioDown.Name = "radioDown";
			this.radioDown.Size = new System.Drawing.Size(48, 24);
			this.radioDown.TabIndex = 3;
			this.radioDown.TabStop = true;
			this.radioDown.Text = "向下";
			// 
			// checkCase
			// 
			this.checkCase.Location = new System.Drawing.Point(16, 72);
			this.checkCase.Name = "checkCase";
			this.checkCase.Size = new System.Drawing.Size(88, 24);
			this.checkCase.TabIndex = 4;
			this.checkCase.Text = "區分大小寫";
			// 
			// label2
			// 
			this.label2.Location = new System.Drawing.Point(16, 48);
			this.label2.Name = "label2";
			this.label2.Size = new System.Drawing.Size(56, 16);
			this.label2.TabIndex = 0;
			this.label2.Text = "替換為";
			// 
			// txtReplace
			// 
			this.txtReplace.Location = new System.Drawing.Point(80, 40);
			this.txtReplace.Name = "txtReplace";
			this.txtReplace.Size = new System.Drawing.Size(160, 21);
			this.txtReplace.TabIndex = 1;
			this.txtReplace.Text = "";
			// 
			// btnSearch
			// 
			this.btnSearch.Location = new System.Drawing.Point(272, 8);
			this.btnSearch.Name = "btnSearch";
			this.btnSearch.TabIndex = 5;
			this.btnSearch.Text = "查找";
			this.btnSearch.Click += new System.EventHandler(this.btnSearch_Click);
			// 
			// btnReplace
			// 
			this.btnReplace.Location = new System.Drawing.Point(272, 40);
			this.btnReplace.Name = "btnReplace";
			this.btnReplace.TabIndex = 6;
			this.btnReplace.Text = "替換";
			this.btnReplace.Click += new System.EventHandler(this.btnReplace_Click);
			// 
			// btnReplaceAll
			// 
			this.btnReplaceAll.Location = new System.Drawing.Point(360, 40);
			this.btnReplaceAll.Name = "btnReplaceAll";
			this.btnReplaceAll.TabIndex = 7;
			this.btnReplaceAll.Text = "全部替換";
			this.btnReplaceAll.Click += new System.EventHandler(this.btnReplaceAll_Click);
			// 
			// SearchAndReplace
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
			this.ClientSize = new System.Drawing.Size(456, 101);
			this.Controls.Add(this.btnReplaceAll);
			this.Controls.Add(this.btnReplace);
			this.Controls.Add(this.btnSearch);
			this.Controls.Add(this.checkCase);
			this.Controls.Add(this.radioDown);
			this.Controls.Add(this.txtSearch);
			this.Controls.Add(this.txtReplace);
			this.Controls.Add(this.radioUp);
			this.Controls.Add(this.label1);
			this.Controls.Add(this.label2);
			this.Name = "SearchAndReplace";
			this.Text = "查找替換";
			this.Load += new System.EventHandler(this.SearchAndReplace_Load);
			this.ResumeLayout(false);

		}
		#endregion

		private string strSearch = ""; // 表示要查找的字符串
		private string strReplace = "";// 表示要替換成的字符串
		private int searchPos = 0,lastSearchPos = 0;// 前者表示當前的查找位置,后者表示上次的查找位置
		private void btnSearch_Click(object sender, System.EventArgs e)
		{
			this.strSearch = this.txtSearch.Text;
			SearchText(true);
		}

		private void btnReplace_Click(object sender, System.EventArgs e)
		{
			this.strSearch = this.txtSearch.Text;
			this.strReplace = this.txtReplace.Text;
			SearchText(true);
			if(this.parentForm.txtMain.SelectedText.Length > 0)
			{
				this.parentForm.txtMain.SelectedText = this.strReplace;
			}
		}

		private void btnReplaceAll_Click(object sender, System.EventArgs e)
		{
			this.strSearch = this.txtSearch.Text;
			this.strReplace = this.txtReplace.Text;
			while(SearchText(false))
			{
				if(this.parentForm.txtMain.SelectedText.Length > 0)
				{
					this.parentForm.txtMain.SelectedText = this.strReplace;
				}
			}
		}
		private bool SearchText(bool ShowNotFind)
			// 函數完成文本的查找功能,參數表示是否在未找到指定文本時顯示消息,
			// 返回值為是否找到指定文本
		{
			bool find = true;
			if(this.checkCase.Checked)// 表示大小寫匹配查找
			{
				if(this.radioDown.Checked) // 表示向下查找
				{
					this.searchPos = this.parentForm.txtMain.Find(this.strSearch,searchPos,
						this.parentForm.txtMain.Text.Length,RichTextBoxFinds.MatchCase);
				}
				else
				{
					this.searchPos = this.parentForm.txtMain.Find(this.strSearch,0,
						searchPos,RichTextBoxFinds.MatchCase | RichTextBoxFinds.Reverse);
				}
			}
			else
			{
				if(this.radioDown.Checked)
				{
					this.searchPos = this.parentForm.txtMain.Find(this.strSearch,searchPos,
						this.parentForm.txtMain.Text.Length,RichTextBoxFinds.None);
				}
				else
				{
					this.searchPos = this.parentForm.txtMain.Find(this.strSearch,0,
						searchPos,RichTextBoxFinds.Reverse);
				}
			}
			if(this.searchPos < 0)//如果未找到,則顯示信息,將上次查找位置復原,置標志位為未找到
			{
				if(ShowNotFind)
				{
					MessageBox.Show("指定的文本未找到","文本編輯器",MessageBoxButtons.OK,
						MessageBoxIcon.Information);
				}
				this.searchPos = this.lastSearchPos;
				find = false;
			}
			else
			{
				if(this.radioDown.Checked)
				{
					this.searchPos += this.strSearch.Length;
				}
				else
				{
					this.searchPos -= this.strSearch.Length;
				}
				this.parentForm.Focus();// 使主窗體獲得焦點
			}
			this.lastSearchPos = this.searchPos;
			return find;
		}

		private void SearchAndReplace_Load(object sender, System.EventArgs e)
		{
		
		}
	}
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美国产日本视频| 国产一区二区影院| 久久99精品国产| 91毛片在线观看| 国产免费久久精品| 蜜桃av一区二区| 欧美性大战久久久久久久 | 成人综合日日夜夜| 3atv一区二区三区| 亚洲精品欧美激情| 波多野结衣欧美| 久久综合九色综合欧美亚洲| 午夜精品在线视频一区| 91在线视频播放地址| 欧美国产精品中文字幕| 九九**精品视频免费播放| 欧美巨大另类极品videosbest | 精品亚洲国产成人av制服丝袜| 91小视频在线观看| 久久久激情视频| 久久99九九99精品| 欧美一区二区三区免费| 舔着乳尖日韩一区| 在线亚洲精品福利网址导航| 综合久久国产九一剧情麻豆| 处破女av一区二区| 国产欧美综合色| 国产在线一区二区| 久久女同互慰一区二区三区| 久久国产综合精品| 日韩欧美在线1卡| 蜜臀av一级做a爰片久久| 在线91免费看| 久久国产精品区| 精品国产亚洲在线| 欧美在线不卡一区| 亚洲成av人片一区二区三区| 欧美午夜一区二区| 午夜精品福利一区二区三区av | 性感美女极品91精品| 欧美做爰猛烈大尺度电影无法无天| 亚洲日本青草视频在线怡红院| 91婷婷韩国欧美一区二区| 中文字幕在线视频一区| 91亚洲精品久久久蜜桃| 亚洲国产另类精品专区| 欧美区视频在线观看| 美女视频黄 久久| 国产日韩欧美精品一区| 成人91在线观看| 亚洲自拍偷拍九九九| 欧美二区在线观看| 精品一区二区久久久| 亚洲国产精品激情在线观看| 色老综合老女人久久久| 午夜影院在线观看欧美| 久久亚洲春色中文字幕久久久| 成人精品国产一区二区4080| 亚洲人xxxx| 欧美成人a∨高清免费观看| 成人妖精视频yjsp地址| 一区av在线播放| 久久综合九色综合欧美98| 97精品超碰一区二区三区| 肉丝袜脚交视频一区二区| 国产日产欧产精品推荐色| 色噜噜久久综合| 免费av成人在线| 亚洲三级电影网站| 欧美不卡一区二区| 97精品久久久久中文字幕| 男人的天堂久久精品| 亚洲欧美综合在线精品| 欧美一区二视频| av综合在线播放| 久久精品国产亚洲一区二区三区| 国产精品欧美极品| 日韩一区和二区| 91视视频在线观看入口直接观看www| 亚洲国产精品一区二区久久| 欧美极品xxx| 欧美一级在线免费| 99re8在线精品视频免费播放| 热久久国产精品| 亚洲专区一二三| 国产精品视频麻豆| 日韩欧美国产三级| 欧美日韩国产一级片| 91在线观看视频| 丁香婷婷综合色啪| 久久99精品久久久久久国产越南| 亚洲综合视频在线观看| 国产精品美女久久福利网站| 精品国产免费人成在线观看| 精品视频一区二区不卡| 国产午夜精品久久久久久免费视 | 精品999久久久| 欧美色图激情小说| 99久久精品国产麻豆演员表| 国产精品99久| 久久国产精品色婷婷| 日韩不卡一区二区| 亚洲成人综合网站| 亚洲黄色片在线观看| 综合中文字幕亚洲| 日韩理论电影院| 中文字幕在线不卡一区二区三区| 国产亚洲美州欧州综合国 | 欧美日韩高清一区二区三区| 一本到不卡精品视频在线观看 | 一区二区视频免费在线观看| 国产精品免费丝袜| 中文字幕va一区二区三区| 亚洲精品在线三区| 日韩一级欧美一级| 欧美一区二区三区免费视频| 这里只有精品视频在线观看| 欧美日韩一区视频| 欧美日韩国产系列| 911国产精品| 日韩欧美亚洲国产另类| 欧美人xxxx| 在线播放日韩导航| 日韩午夜精品视频| 精品国产成人系列| 天堂久久一区二区三区| 婷婷国产v国产偷v亚洲高清| 视频一区二区三区在线| 久久99九九99精品| 国产成人一级电影| av在线一区二区| 欧美视频中文一区二区三区在线观看| 欧美手机在线视频| 日韩免费性生活视频播放| 国产亚洲精品资源在线26u| 中文字幕一区二区三区在线观看| 亚洲丝袜制服诱惑| 午夜视频在线观看一区二区| 日韩电影在线观看网站| 久久国产精品一区二区| 成人午夜激情片| 欧美亚洲免费在线一区| 日韩精品一区二区三区四区| 日本一区二区三区久久久久久久久不| 亚洲男人的天堂一区二区| 丝袜诱惑制服诱惑色一区在线观看 | 国产又粗又猛又爽又黄91精品| 国产成人在线网站| 欧美性大战久久| xfplay精品久久| 亚洲精品乱码久久久久久黑人 | 亚洲国产精品高清| 亚洲最新视频在线观看| 国产综合色产在线精品| 欧美中文字幕一区| www日韩大片| 亚洲成人激情综合网| 国产一区二区精品久久99| 欧美性感一类影片在线播放| 久久奇米777| 午夜欧美在线一二页| 成人黄色在线网站| 日韩精品专区在线| 亚洲视频每日更新| 久久99九九99精品| 一本到高清视频免费精品| 久久亚洲一区二区三区明星换脸| 亚洲一区二区视频在线| 国产a视频精品免费观看| 欧美精品少妇一区二区三区| 国产精品第五页| 狠狠色丁香久久婷婷综合丁香| 欧美视频你懂的| 亚洲天堂2016| 国产**成人网毛片九色| 欧美成人伊人久久综合网| 国产超碰在线一区| 正在播放亚洲一区| 亚洲精品网站在线观看| 成人高清伦理免费影院在线观看| 欧美成人video| 日韩av在线播放中文字幕| 欧美性videosxxxxx| 亚洲婷婷国产精品电影人久久| 国产美女精品一区二区三区| 日韩欧美国产三级电影视频| 午夜精品久久久久久久| 色婷婷国产精品综合在线观看| 中文字幕中文字幕中文字幕亚洲无线| 精品午夜久久福利影院| 日韩一级片网站| 蜜桃精品视频在线| 日韩一级二级三级| 麻豆国产欧美一区二区三区| 日韩欧美aaaaaa| 久久精品国产99| 精品处破学生在线二十三| 免费成人你懂的| 久久综合中文字幕| 久久se这里有精品|