CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    May 2001
    Posts
    155

    Find and replace......

    I know how to search a richtextbox. but when it finds the string that it's searching for, how do you make it replace that string with a "p"?

    --Ant
    --------------------------------------------------
    check out my newest freeware
    E-mail me at: [email protected]
    for the address

  2. #2
    Join Date
    May 2001
    Location
    Russia
    Posts
    200

    Re: Find and replace......

    RichTextBox1.Text = Replace(RichTextBox1.Text, strFindString, strReplaceString)

    Andy Tower

  3. #3
    Join Date
    Apr 2000
    Location
    South Carolina,USA
    Posts
    2,210

    Re: Find and replace......

    In addition to Towers response, the RichTextBox has a "Find" method that go's something like this:

    Richtextbox1.Find(string,start,end,options)



    GO to MSDN Help and search for "Find Method". It will explain the parameters in detail.
    It is a little more selective in what it searches

    John G

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

Featured