hmmm... from your code I bet the entries into the list box are not quite what you are expecting...
Then...Code:If Left(sNextLine, 6) = "ALARM=" Then List1.AddItem sNextLine Redim Preserve MyArray(List1.ListCount) As String MyArray(List1.ListCount) = sNextLine Else MyArray(List1.ListCount) = MyArray(List1.ListCount) & sNextLine End If
Code:Private Sub List1_Click() Dim ForLoopCounter As Integer For ForLoopCounter = 0 To List1.ListCount - 1 If List1.Selected(ForLoopCounter) = True Then Text1.Text = MyArray(ForLoopCounter + 1) Exit For End If Next ForLoopCounter End Sub
Good Luck




Reply With Quote