vb内容查找和替换

时间:2016-01-21 12:43:57
【文件属性】:

文件名称:vb内容查找和替换

文件大小:52KB

文件格式:RAR

更新时间:2016-01-21 12:43:57

查找和替换

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


【文件预览】:
查找替换
----查找替换.suo(12KB)
----查找替换.sln(925B)
----查找替换()
--------obj()
--------bin()
--------查找替换.vbproj(4KB)
--------Form1.resx(6KB)
--------Form1.Designer.vb(6KB)
--------My Project()
--------Form1.vb(2KB)

网友评论