Results 1 to 3 of 3

Thread: [RESOLVED] Wanting Reference of Line Number of RichTextbox but Gort Error bc30057 Too Many....

  1. #1

    Thread Starter
    Banned
    Join Date
    May 2021
    Posts
    180

    Resolved [RESOLVED] Wanting Reference of Line Number of RichTextbox but Gort Error bc30057 Too Many....

    Hello

    I am creating Sub for RicthTextbox with its Reference of Line Number

    Almost on the net have explored but could have missed out if the narration for the same could have been in different Terms and wordings

    Can Someone Help me to correct the below
    Code:
    Sub LineNumber(ByRef currentRichTextbox As RichTextBox)
            Dim lineNo As Integer
            currentRichTextbox.Lines(LineNo)
        End Sub
    OR
    Code:
    Sub LineNumber(ByRef currentRichTextbox As RichTextBox, ByVal LineNo As Integer)
            
            currentRichTextbox.Lines(LineNo)
        End Sub
    For both the codes Am Getting Error As
    bc30057 too many arguments to Public Overloads Property Lines As String

    Your help will always be appreciated
    SamD
    175

  2. #2

    Thread Starter
    Banned
    Join Date
    May 2021
    Posts
    180

    Re: Wanting Reference of Line Number of RichTextbox but Gort Error bc30057 Too Many.

    FYI

    Have realized the mistake and the above method is not proper method

    Adapted fromhttps://stackoverflow.com/questions/...-a-richtextbox

    Code:
    Private Sub Private Sub Test(ByRef currentRichTextbox As RichTextBox, ByRef txtStr As String)
        Dim i As Integer = 0
            For Each Line As String In currentRichTextbox.Lines
                currentRichTextbox.Select(RichTextBox1.GetFirstCharIndexFromLine(i), Line.Length)
               i += 1
            Next
    SamD
    176

  3. #3
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,474

    Re: Wanting Reference of Line Number of RichTextbox but Gort Error bc30057 Too Many.

    So, is this issue resolved? If so, please use the Thread Tools menu to mark the thread Resolved, so that we know you need no more help without having to open the thread and read it all.

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