求在RichTextbox 查找的代码?
dwyao 2005-09-06 03:30:01 求在RichTextbox 查找的代码?
文本中,有几个匹配的字符串,但在查找时,总是查找到第一个匹配的字符串,我的代码如下:
Dim FoundPos As Integer
With frmEditCon
FoundPos = .rtxt1.Find(Trim(Text1.Text), .rtxt1.SelStart + .rtxt1.SelLength + 1)
If FoundPos <> -1 Then
.rtxt1.SetFocus
.rtxt1.SelStart = FoundPos
.rtxt1.SelLength = Len(Text1.Text)
End If
End With