Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim TheCollectionOfTitles As XmlNodeList
Dim IndividualTitle
As XmlNode
Dim RecipeTitle As String
doc = New XmlDocument()
doc.Load(RecipesFilePath)
lstTitles.Sorted
= True
If Not My.Computer.FileSystem.FileExists(RecipesFilePath)
Then
MsgBox("We were
unable to open the cookbook's XML file: " & RecipesFilePath)
End
End If
TheCollectionOfTitles
= doc.GetElementsByTagName("title")
For Each IndividualTitle
In
TheCollectionOfTitles
RecipeTitle
= IndividualTitle.InnerText
lstTitles.Items.Add(RecipeTitle)
Next IndividualTitle
lstTitles.SelectedIndex = 0
Call
lstTitles_Click(Me, e)
End Sub