|
-
Jun 16th, 2010, 06:48 PM
#1
Thread Starter
Member
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
-
Jun 16th, 2010, 06:51 PM
#2
Re: Help with "Error 1 Overload resolution failed because no accessible 'find' ..."
vb Code:
RichTextBox1.Find("text to find")
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Jun 16th, 2010, 06:53 PM
#3
Re: Help with "Error 1 Overload resolution failed because no accessible 'find' ..."
What happens when you type this much
RichTextBox1.Find(
-
Jun 16th, 2010, 06:55 PM
#4
Thread Starter
Member
Re: Help with "Error 1 Overload resolution failed because no accessible 'find' ..."
 Originally Posted by .paul.
vb Code:
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. :/
-
Jun 16th, 2010, 06:56 PM
#5
Thread Starter
Member
Re: Help with "Error 1 Overload resolution failed because no accessible 'find' ..."
 Originally Posted by dbasnett
What happens when you type this much
RichTextBox1.Find(
It shows a blue squiggly line to the bottom-right of the "("
-
Jun 16th, 2010, 06:58 PM
#6
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?
-
Jun 16th, 2010, 07:00 PM
#7
Thread Starter
Member
Re: Help with "Error 1 Overload resolution failed because no accessible 'find' ..."
 Originally Posted by dbasnett
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
-
Jun 16th, 2010, 07:20 PM
#8
Re: Help with "Error 1 Overload resolution failed because no accessible 'find' ..."
vb Code:
RichTextBox1.Find(textbox1.text)
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Jun 16th, 2010, 07:28 PM
#9
Thread Starter
Member
Re: Help with "Error 1 Overload resolution failed because no accessible 'find' ..."
 Originally Posted by .paul.
vb Code:
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
-
Jun 16th, 2010, 07:30 PM
#10
Re: Help with "Error 1 Overload resolution failed because no accessible 'find' ..."
 Originally Posted by Tech Geek 7331
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
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Jun 16th, 2010, 07:36 PM
#11
Thread Starter
Member
Re: Help with "Error 1 Overload resolution failed because no accessible 'find' ..."
 Originally Posted by .paul.
in case i misunderstood you, there is no find dialog box. you'd have to create your own custom dialog
Ohh boy
-
Jun 16th, 2010, 07:37 PM
#12
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:
RichTextBox1.selectionstart = RichTextBox1.Find("quick") 'it will find at index 4
richtextbox1.selectionlength = 5 '"quick" = 5 characters
will find + select the search text
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Jun 16th, 2010, 07:51 PM
#13
Thread Starter
Member
Re: Help with "Error 1 Overload resolution failed because no accessible 'find' ..."
 Originally Posted by .paul.
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:
RichTextBox1.selectionstart = RichTextBox1.Find("quick") 'it will find at index 4
richtextbox1.selectionlength = 5 '"quick" = 5 characters
will find + select the search text
...How good are you at making Find dialog boxes?
-
Jun 16th, 2010, 07:59 PM
#14
Re: Help with "Error 1 Overload resolution failed because no accessible 'find' ..."
 Originally Posted by Tech Geek 7331
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
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
|