Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
查找和替换.cs
Package: Notebook.rar [view]
Upload User: hueiseng
Upload Date: 2022-07-26
Package Size: 156k
Code Size: 4k
Category:
CSharp
Development Platform:
Visual C++
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Text;
- using System.Windows.Forms;
- namespace 笔记本
- {
- public partial class 查找 : Form
- {
- static int findplace = 0;
- public 查找()
- {
- InitializeComponent();
- }
- public string note
- {
- get
- {
- return textBox1.Text;
- }
- }
- private void textBox1_TextChanged(object sender, EventArgs e)
- {
- if (textBox1.Text.Length > 0)
- button1.Enabled = true;
- else
- button1.Enabled = false;
- }
- private void button1_Click(object sender, EventArgs e)
- {
- Form1 f1 = (Form1)this.Owner;
- f1.Activate();
- if (textBox1.Text.Length > 0)
- {
- if (!checkBox1.Checked)
- {
- if (radioButton1.Checked)
- {
- findplace = f1.richTextBox1.SelectionStart - 1;
- if (findplace < 0)
- {
- MessageBox.Show("无法找到搜索项!");
- findplace = 0;
- }
- else
- {
- findplace = f1.richTextBox1.Text.LastIndexOf(textBox1.Text, findplace);
- f1.richTextBox1.Select(findplace, textBox1.Text.Length);
- }
- }
- if (radioButton2.Checked)
- {
- findplace = f1.richTextBox1.Text.IndexOf(textBox1.Text, findplace);
- if (findplace == -1)
- {
- MessageBox.Show("无法找到搜索项!");
- findplace = f1.richTextBox1.SelectionStart;
- }
- else
- {
- f1.richTextBox1.Select(findplace, textBox1.Text.Length);
- findplace = f1.richTextBox1.SelectionStart + textBox1.Text.Length;
- }
- }
- }
- else
- {
- if (radioButton1.Checked)
- {
- findplace = f1.richTextBox1.SelectionStart - 1;
- if (findplace < 0)
- {
- MessageBox.Show("无法找到搜索项!");
- findplace = 0;
- }
- else
- {
- findplace = f1.richTextBox1.Text.LastIndexOf(textBox1.Text, findplace, StringComparison.OrdinalIgnoreCase);
- f1.richTextBox1.Select(findplace, textBox1.Text.Length);
- }
- }
- if (radioButton2.Checked)
- {
- findplace = f1.richTextBox1.Text.IndexOf(textBox1.Text, findplace, StringComparison.OrdinalIgnoreCase);
- if (findplace == -1)
- {
- MessageBox.Show("无法找到搜索项!");
- findplace = f1.richTextBox1.SelectionStart;
- }
- else
- {
- f1.richTextBox1.Select(findplace, textBox1.Text.Length);
- findplace = f1.richTextBox1.SelectionStart + textBox1.Text.Length;
- }
- }
- }
- }
- }
- }
- }