Find and replace for richtextbox functionality in 2.0

Posted on 2009-04-24
Last Modified: 2012-08-13
Can anybody give an example of 'Find, replace and replaceall functionality for richtextbox which is case INSENSITIVE.

Question by:RIAS
    LVL 7

    Expert Comment

    the following code change all "Abc" , "ABc" etc in RichTextBox1 to "cde"

     Me.RichTextBox1.Text = Me.RichTextBox1.Text.ToLower.Replace("abc", "cde")

    Open in new window

    LVL 7

    Expert Comment

    the following code return true if richtextbox1 contains "abc" or "Abc" etc


    Open in new window


    Author Comment

    Cheers for the reply but the code I am using is
      'find the start of the next found item in the sql file
                    xStart = SQLBox.Find(xFind, SearchFrom, Windows.Forms.RichTextBoxFinds.WholeWord)

    S othe suggestions aren't working :<
    LVL 7

    Accepted Solution

    how about this?

    xStart = InStr(0, Me.SQLBox.Text.ToLower(), "abc", CompareMethod.Text)

    Open in new window


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    This is an explanation of a simple data model to help parse a JSON feed
    Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
    In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
    In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now