Quantcast
Channel: SharePoint 2010 - Setup, Upgrade, Administration and Operations forum
Viewing all articles
Browse latest Browse all 13778

Value cannot be null. Parameter name: str-VB.NET

$
0
0

How do you solve this issue in VB.NET on this section below?

 startindex = RichTextBox1.Find(checkWord, startindex, RichTextBox1.TextLength, RichTextBoxFinds.WholeWord)

Value cannot be null. Parameter name: str

Here is the code

Private Sub btnFind_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnFind.Click

        Dim startindex As Integer = 0

        If RichTextBox1.Text.Length > 0 Then

            startindex = RichTextBox1.Find(checkWord, startindex, RichTextBox1.TextLength, RichTextBoxFinds.WholeWord)

        End If


        ' If string was found in the RichTextBox, highlight it
        If startindex >= 0 Then
            ' Set the highlight color as red
            RichTextBox1.SelectionColor = Color.Red
            ' Find the end index. End Index = number of characters in textbox
            Dim endindex As Integer = checkWord.Length
            ' Highlight the search string
            RichTextBox1.Select(startindex, endindex)
            ' mark the start position after the position of
            ' last search string
            start = startindex + endindex
        End If
    End Sub


Kelvin Nyota From Researchpaperstobuy.com



Viewing all articles
Browse latest Browse all 13778

Latest Images

Trending Articles



Latest Images