Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8091937
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T20:10:46+00:00 2026-06-05T20:10:46+00:00

Public Sub MyFunction() Dim lowstring As String lowstring = hi Me.RichTextView.Find(lowstring, 0, 2) End

  • 0
Public Sub MyFunction()
    Dim lowstring As String
    lowstring = "hi"
    Me.RichTextView.Find(lowstring, 0, 2)
End Sub

The above produces the error of

Overload resolution failed because no accessible 'Find' can be called without a narrowing conversion:


Public Function Find(characterSet() As Char, 
    start As Integer, end As Integer) As Integer:

Argument matching parameter 'characterSet' narrows
from 'String' to '1-dimensional array of Char'.


Public Function Find(str As String, start As Integer, 
    options As System.Windows.Forms.RichTextBoxFinds) As Integer: 

Argument matching parameter 'options' narrows from 'Integer' to
'System.Windows.Forms.RichTextBoxFinds'.

The error doesn’t occur if you change the replacement string value, only if you change the second or third values to something other than 0.

Why doesn’t the use of standard integers work here? What does this error really mean? Can anyone point me to some documentation for handling overloaded functions in vb.net (2010)?

I hope this question is focused enough… I’ve just been pretty confused about this one.

Thanks for any help – EB

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T20:10:48+00:00Added an answer on June 5, 2026 at 8:10 pm

    As you can see, RichTextBox.Find has 7 overloads.
    The one you’re calling with 3 arguments and two integers takes a Char[] as first parameter, not a String.

    This overload is used when you want to find the first instance of a character from a list of characters.

    I assume that you want to find the position of your string in a given range. Then you need to use this overload: RichTextBox.Find(String, Int32, Int32, RichTextBoxFinds).

    For example:

    ' Obtain the location of the search string in RichTextView'
    Dim index = RichTextView.Find(lowstring, 0, 2, RichTextBoxFinds.WholeWord)
    

    Note that you can combine different RichTextBoxFinds bitwise.

    For example:

    Dim index = Me.RichTextView.Find(
            lowstring,
            0,
            2,
            RichTextBoxFinds.WholeWord Or RichTextBoxFinds.MatchCase
        )
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Public Sub textcolorchanged() Dim searchword As String = RichTextBox2.Text.ToString.Trim Dim index1 As Integer =
I have a VB method Public Sub append_text(ByVal s As String) f1.TextBox1.AppendText(s) End Sub
Public Enum Fruit Red_Apple = 1 Oranges Ripe_Banana End Enum Private Sub InitCombosRegular() Dim
For example: Public Class Class1 Public Sub Some() Dim Image As New Bitmap(C:\image.bmp) End
Public Sub cleanTables(ByVal prOKDel As Short) Dim sqlParams(1) As SqlParameter Dim sqlProcName As String
Public Sub WriteTextFile(ByVal SourceToWrite As String, ByVal LocationToWrite As String) Dim file As System.IO.StreamWriter
I have the following code: <TestMethod()> _ Public Sub GetDirectoryEntryTest() Dim path As String
I've got the following code: Public Delegate Sub SetStatusBarTextDelegate(ByVal StatusText As String) Private Sub
Module Module1 Public cccounter = 9 End Module Public Class frmNim Private Sub btnSelect_Click(sender
Public Class ABC Public Sub Foo() AA.Bar(nothing, Sub() End Sub) End Sub End Class

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.