One option is to use a class to hold each entry and override the ToString function to return the heading. Now you can add each entry directly to listbox1 and it will show the title to represent the item. Since each listbox item actually is an object you can cast the selected item as your entry class and read the data from the object. Here's one way to do it:
Public Class Entry
Public Property Title As String = ""
Public Property Data As New List(Of String)
Public Overrides Function ToString() As String
Return Title
End Function
End Class
Private Sub Form4_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim sr As New StreamReader("textfile1.txt")
Do Until (sr.EndOfStream)
Dim line As String = sr.ReadLine.Trim
If line.StartsWith("[") Then
Dim newentry As New Entry
newentry.Title = line
Do Until (line = "" OrElse sr.EndOfStream)
line = sr.ReadLine.Trim
If Not line = "" Then
newentry.Data.Add(line)
End If
Loop
ListBox1.Items.Add(newentry)
End If
Loop
End Sub
Private Sub ListBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ListBox1.SelectedIndexChanged
Dim selectedentry As Entry = DirectCast(DirectCast(sender, ListBox).SelectedItem, Entry)
ListBox2.Items.Clear()
For Each datum In selectedentry.Data
Dim line As String() = datum.Split("=,".ToCharArray, StringSplitOptions.RemoveEmptyEntries)
If line.Count > 2 Then
ListBox2.Items.Add(line(2) + vbTab + line(0) + vbTab + line(1))
Else
ListBox2.Items.Add(" " + vbTab + line(0) + vbTab + line(1))
End If
Next
End Sub