Results 1 to 14 of 14

Thread: Help with "Error 1 Overload resolution failed because no accessible 'find' ..."

  1. #1

    Thread Starter
    Member
    Join Date
    Jun 2010
    Posts
    34

    Help with "Error 1 Overload resolution failed because no accessible 'find' ..."

    Hi there, I've been working on my own version of Notepad/Wordpad and I just tried adding the Find feature for the Rich Text box and I got an error. Here's the code I had:
    Code:
        Private Sub FindToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles FindToolStripMenuItem.Click
            RichTextBox1.Find()
        End Sub
    And here's the error:
    Code:
    Error	1	Overload resolution failed because no accessible 'Find' accepts this number of arguments.	C:\Users\Jake\documents\visual studio 2010\Projects\Rich Text Application\Rich Text Application\Form1.vb	82	9	Rich Text Application
    Please help me with how to fix this!
    Thanks,
    Jake

  2. #2
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    26,423

    Re: Help with "Error 1 Overload resolution failed because no accessible 'find' ..."

    vb Code:
    1. RichTextBox1.Find("text to find")

  3. #3
    Powered By Medtronic dbasnett's Avatar
    Join Date
    Dec 2007
    Location
    Jefferson City, MO
    Posts
    9,897

    Re: Help with "Error 1 Overload resolution failed because no accessible 'find' ..."

    What happens when you type this much

    RichTextBox1.Find(
    My First Computer -- Documentation Link (RT?M) -- Using the Debugger -- Prime Number Sieve
    Counting Bits -- Subnet Calculator -- UI Guidelines -- >> SerialPort Answer <<

    "Those who use Application.DoEvents have no idea what it does and those who know what it does never use it." John Wein

  4. #4

    Thread Starter
    Member
    Join Date
    Jun 2010
    Posts
    34

    Re: Help with "Error 1 Overload resolution failed because no accessible 'find' ..."

    Quote Originally Posted by .paul. View Post
    vb Code:
    1. RichTextBox1.Find("text to find")
    That only looks for the words "text to find". I want the user to be able to type the word(s) they want to find in a box instead of just having the program find those three words. :/

  5. #5

    Thread Starter
    Member
    Join Date
    Jun 2010
    Posts
    34

    Re: Help with "Error 1 Overload resolution failed because no accessible 'find' ..."

    Quote Originally Posted by dbasnett View Post
    What happens when you type this much

    RichTextBox1.Find(
    It shows a blue squiggly line to the bottom-right of the "("

  6. #6
    Powered By Medtronic dbasnett's Avatar
    Join Date
    Dec 2007
    Location
    Jefferson City, MO
    Posts
    9,897

    Re: Help with "Error 1 Overload resolution failed because no accessible 'find' ..."

    If you put the cursor to the right of the blue squiggly and press space, what happens?
    My First Computer -- Documentation Link (RT?M) -- Using the Debugger -- Prime Number Sieve
    Counting Bits -- Subnet Calculator -- UI Guidelines -- >> SerialPort Answer <<

    "Those who use Application.DoEvents have no idea what it does and those who know what it does never use it." John Wein

  7. #7

    Thread Starter
    Member
    Join Date
    Jun 2010
    Posts
    34

    Re: Help with "Error 1 Overload resolution failed because no accessible 'find' ..."

    Quote Originally Posted by dbasnett View Post
    If you put the cursor to the right of the blue squiggly and press space, what happens?
    It moves the blue squiggly over to the right one space

  8. #8
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    26,423

    Re: Help with "Error 1 Overload resolution failed because no accessible 'find' ..."

    vb Code:
    1. RichTextBox1.Find(textbox1.text)

  9. #9

    Thread Starter
    Member
    Join Date
    Jun 2010
    Posts
    34

    Re: Help with "Error 1 Overload resolution failed because no accessible 'find' ..."

    Quote Originally Posted by .paul. View Post
    vb Code:
    1. RichTextBox1.Find(textbox1.text)
    I put:
    Code:
    RichTextBox1.Find(RichTextBox1.Text)
    and no errors showed up, but when I run the application and click "Find" nothing happens

  10. #10
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    26,423

    Re: Help with "Error 1 Overload resolution failed because no accessible 'find' ..."

    Quote Originally Posted by Tech Geek 7331 View Post
    That only looks for the words "text to find". I want the user to be able to type the word(s) they want to find in a box instead of just having the program find those three words. :/
    in case i misunderstood you, there is no find dialog box. you'd have to create your own custom dialog

  11. #11

    Thread Starter
    Member
    Join Date
    Jun 2010
    Posts
    34

    Re: Help with "Error 1 Overload resolution failed because no accessible 'find' ..."

    Quote Originally Posted by .paul. View Post
    in case i misunderstood you, there is no find dialog box. you'd have to create your own custom dialog
    Ohh boy

  12. #12
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    26,423

    Re: Help with "Error 1 Overload resolution failed because no accessible 'find' ..."

    RichTextBox1.Find(RichTextBox1.Text)???

    that tells the richtextbox to find it's own text, which would always return 0. the find method returns an integer indicating the character index position of the found text.

    assuming your richtextbox text is:

    the quick brown fox jumped over the lazy dog
    vb Code:
    1. RichTextBox1.selectionstart = RichTextBox1.Find("quick") 'it will find at index 4
    2. richtextbox1.selectionlength = 5 '"quick" = 5 characters
    will find + select the search text

  13. #13

    Thread Starter
    Member
    Join Date
    Jun 2010
    Posts
    34

    Re: Help with "Error 1 Overload resolution failed because no accessible 'find' ..."

    Quote Originally Posted by .paul. View Post
    RichTextBox1.Find(RichTextBox1.Text)???

    that tells the richtextbox to find it's own text, which would always return 0. the find method returns an integer indicating the character index position of the found text.

    assuming your richtextbox text is:



    vb Code:
    1. RichTextBox1.selectionstart = RichTextBox1.Find("quick") 'it will find at index 4
    2. richtextbox1.selectionlength = 5 '"quick" = 5 characters
    will find + select the search text
    ...How good are you at making Find dialog boxes?

  14. #14
    Powered By Medtronic dbasnett's Avatar
    Join Date
    Dec 2007
    Location
    Jefferson City, MO
    Posts
    9,897

    Re: Help with "Error 1 Overload resolution failed because no accessible 'find' ..."

    Quote Originally Posted by Tech Geek 7331 View Post
    It moves the blue squiggly over to the right one space
    IntelliSense should be showing some (7?) hints...

    http://msdn.microsoft.com/en-us/libr...tbox.find.aspx
    My First Computer -- Documentation Link (RT?M) -- Using the Debugger -- Prime Number Sieve
    Counting Bits -- Subnet Calculator -- UI Guidelines -- >> SerialPort Answer <<

    "Those who use Application.DoEvents have no idea what it does and those who know what it does never use it." John Wein

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