yulyos
Well-known member
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:
VB.NET:
[LEFT][COLOR=blue][FONT=Courier New]For[/FONT][/COLOR][FONT=Courier New] n [COLOR=blue]As[/COLOR] [COLOR=blue]Integer[/COLOR] = 0 [COLOR=blue]To[/COLOR] ListBox1.Items.Count - 1[/FONT]
[FONT=Courier New] [COLOR=blue]If[/COLOR] Trim(Mid(ListBox1.Items(n), 19, 40)).Trim = TextBox3.Text.Trim [COLOR=blue]Then[/COLOR][/FONT]
[FONT=Courier New] MessageBox.Show(Trim(Mid(ListBox1.Items(n), 19, 40)))[/FONT]
[FONT=Courier New] [COLOR=blue]End[/COLOR] [COLOR=blue]If[/COLOR][/FONT]
[COLOR=blue][FONT=Courier New]Next[/FONT][/COLOR][/LEFT]
I feel that I wrote like old style (VB6)
Can somebody improve this code (To VB2005)?
Can somebody improve this code (To VB2005)?