-
All i need to finally finish my program is the find/replace box. It doesnt have to be the standard one, it can just be a small form with a textbox and buttons, etc. Can someone please help me out?
BTW, another question i gave up on is how do i make a redo. I found out how to do an undo, and nobody would help me with redo so im just taking that out.
Thanks,
-CHR1S
-
To find text, use this code which will also find the word multiple times, if it's in a string/textbox more than once.
Code:
Private Sub Command1_Click()
Dim iPos As Integer
Dim strSearch As String
strSearch = MyStr
iPos = InStr(Text1.SelStart + Len(strSearch), Text1.Text, strSearch)
If iPos Then Text1.SelStart = iPos - 1
Text1.SelLength = Len(strSearch)
Text1.SetFocus
End Sub
And it's easy to figure out how to replace a word once, and use the Replace function to replace all text.
-
how would i use it? im not all that advanced in vb...yet.
-
-
Thanks! that code worked perfectly!