Results 1 to 5 of 5

Thread: All i need...Help me out!

  1. #1

    Thread Starter
    Member
    Join Date
    Nov 2000
    Posts
    56
    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

  2. #2
    Matthew Gates
    Guest
    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.

  3. #3

    Thread Starter
    Member
    Join Date
    Nov 2000
    Posts
    56
    how would i use it? im not all that advanced in vb...yet.

  4. #4
    Megatron
    Guest
    See this link.

  5. #5

    Thread Starter
    Member
    Join Date
    Nov 2000
    Posts
    56
    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
  •  



Click Here to Expand Forum to Full Width