vb内容查找和替换
Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click RichTextBox1.LoadFile(TextBox1.Text, RichTextBoxStreamType.RichText) RichTextBox1.Focus() End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click If RichTextBox1.Modified = True Then RichTextBox1.SaveFile(TextBox1.Text, RichTextBoxStreamType.RichText) ElseIf RichTextBox1. Modified = False Then MessageBox.Show("已保存") RichTextBox1.Focus() End If End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click Dim str1 As String str1 = TextBox2.Text Str = RichTextBox1.Find(str1, Str, RichTextBoxFinds.MatchCase) If str = -1 Then MessageBox.Show("已查找到文档的结尾!", "查找结束") str = 0 Else str = str + str1.Length End If RichTextBox1.Focus() End Sub Dim str As Integer Private Sub TextBox2_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox2.TextChanged '修改查找文本判定’ str = 0 End Sub End Class
文件列表
查找替换.rar
(预估有个25文件)
查找替换
查找替换.suo
12KB
查找替换.sln
925B
查找替换
obj
Release
查找替换.vbproj.FileListAbsolute.txt
738B
Debug
查找替换.Form1.resources
180B
查找替换.exe
32KB
暂无评论