-1
当你打开记事本并输入10行后&然后点击找到它打开对话框 当我们选择单选按钮时。它在上方找到字符串。我想在VB 6.0代码做同样的搜索过程 我曾尝试这个代码,但它正向查找字符串在vb 6.0中如何向后搜索一个字符串
Private Sub btnfind_Click()
str = InputBox("Enter string to search", "Find")
pos = RichTextBox1.Find(str)
If pos <> -1 Then
RichTextBox1.SetFocus
Else
MsgBox "not found"
End If
btnfindnext.Enabled = True
btnprevious.Enabled = True
End Sub
Private Sub btnfindnext_Click()
pos = RichTextBox1.Find(str, pos + 1)
If pos <> -1 Then
RichTextBox1.SetFocus
Else
pos = RichTextBox1.Find(str, 0)
RichTextBox1.SetFocus
End If
End Sub
什么样的代码你试过吗? – BenR