|
-
Apr 7th, 2001, 04:20 PM
#1
Thread Starter
Member
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
-
Apr 7th, 2001, 05:03 PM
#2
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.
-
Apr 7th, 2001, 05:17 PM
#3
Thread Starter
Member
how would i use it? im not all that advanced in vb...yet.
-
Apr 7th, 2001, 05:28 PM
#4
-
Apr 7th, 2001, 05:58 PM
#5
Thread Starter
Member
Thanks! that code worked perfectly!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|