
Originally Posted by
redneckrider
I just need help declaring the name with a value in the list box.
And How do I list each listbox number so I can retrieve it back as a price value to put in a formula. Thank you.
If that's all you want to do, then you can simply swap your listbox for a listview.
vb.net Code:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'create a listview, set View to "List"
'adding a book you can do this:
Dim book As ListViewItem = New ListViewItem
book.Text = "Put your book title here"
book.SubItems.Add("19.99")
ListView1.Items.Add(book)
'It will only display the book title, and keep the Price Associated with it.
End Sub
Private Sub ListView1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ListView1.SelectedIndexChanged
'now to get the amount:
Dim bookprice As Decimal = Decimal.Parse(ListView1.Items(0).SubItems(1).Text)
'example
Me.Text = bookprice
End Sub