'This code takes the selected item from a list box and breaks it up (parses it) 'FROM RON'S PET STORE PROJECT (SEE LESSON 3 ON WEBSITE) 'The name of the product, the price, and the name of the image of that product is stored 'inside the list box as one long string as shown below. lstProducts.Items.Add("Birds 49.95 bird.jpg") lstProducts.Items.Add("Horse 649.95 colt.jpg") lstProducts.Items.Add("Fish 4.95 fish.jpg") lstProducts.Items.Add("Cats 29.95 kitten.jpg") lstProducts.Items.Add("Puppy 29.95 puppy.jpg") lstProducts.Items.Add("Rabbit 39.95 rabbit.jpg") lstProducts.Items.Add("Sheep 249.95 sheep.jpg") lstProducts.Items.Add("Turtle 6.49 turtle.jpg") 'When they choose an item from the list box, this event is triggered: Private Sub lstProducts_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lstProducts.SelectedIndexChanged Dim itemChosen As String Dim itemPrice As String Dim itemPhoto As String itemChosen = Trim(Mid(lstProducts.SelectedItem, 1, 10)) 'start at column 1 & select next 10 itemPrice = Trim(Mid(lstProducts.SelectedItem, 20, 15)) 'start at col 20 & take next 15 itemPhoto = Trim(Mid(lstProducts.SelectedItem, 40)) 'start at col 40 & select all the rest txtItem.Text = itemChosen txtPrice.Text = itemPrice picThumbs.Image = Image.FromFile("..\images\" & itemPhoto) End Sub