Hi,

I am using Visual Basic 2005 Express Edition

I have to find a string in record of a ListBox; the string is in fixed place on the record.

I wrote this code and this code working ok:
Code:
For n As Integer = 0 To ListBox1.Items.Count - 1
    If Trim(Mid(ListBox1.Items(n), 19, 40)).Trim = TextBox3.Text.Trim Then
        MessageBox.Show(Trim(Mid(ListBox1.Items(n), 19, 40)))
    End If
Next
I feel that I wrote like old style (VB6)

Can somebody improve this code (To VB2005)?