Hi,
im encountering error in this code, Kindly help me
Error Line.Code:Private Sub txtSearch_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtSearch.TextChanged ' Dim selArray As ListView.SelectedListViewItemCollection = ListView1.SelectedItems ' If selArray.Count > 0 Then ListView1.Items.Clear() Dim itm As ListViewItem Dim i As Integer For i = 0 To ListView1.Items.Count - 1 ListView1.Items.Item(i).BackColor = Color.White ListView1.Items.Item(i).ForeColor = Color.Black Next With ListView1 itm = .FindItemWithText(txtSearch.Text, True, 0, True) 'tell me what im going to do in this line for searching that kind of method rtb1.Text = System.IO.File.ReadAllText(IO.Path.Combine(scriptPath, itm(0).Text)) If Not itm Is Nothing Then .Items.Item(itm.Index).EnsureVisible() .Items.Item(itm.Index).BackColor = Color.CornflowerBlue .Items.Item(itm.Index).ForeColor = Color.White .Items.Item(itm.Index).Selected = True Else MsgBox("No Record Found!") For i = 0 To ListView1.Items.Count - 1 ListView1.Items.Item(i).BackColor = Color.White ListView1.Items.Item(i).ForeColor = Color.Black Next .Items(0).EnsureVisible() .Items.Item(0).BackColor = Color.CornflowerBlue .Items.Item(0).ForeColor = Color.White .Items.Item(0).Selected = True txtSearch.SelectionStart = 0 txtSearch.SelectionLength = Len(txtSearch.Text) txtSearch.Focus() End If ' End if End With itm = Nothing End Sub
Code:rtb1.Text = System.IO.File.ReadAllText(IO.Path.Combine(scriptPath, itm(0).Text))




Reply With Quote