Hi @Matthew Turcotte ,
You can store Key-Value pair in listbox.
Check the following example.
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
ComboBox1.Items.Add(100)
ComboBox1.Items.Add(150)
ComboBox1.Items.Add(200)
Dim dic As Dictionary(Of String, Double) = New Dictionary(Of String, Double)()
dic.Add("College A", 4) '4 per credit hour'
dic.Add("College B", 4.5)
dic.Add("College C", 5)
ListBox1.DataSource = New BindingSource(dic, Nothing)
ListBox1.DisplayMember = "Key"
ListBox1.ValueMember = "Value"
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
If ComboBox1.SelectedItem IsNot Nothing Then
Label1.Text = CDbl(ListBox1.SelectedValue) * CDbl(ComboBox1.SelectedItem)
End If
End Sub
Result of my test.
Hope it could be helpful.
Best Regards,
Xingyu Zhao
*
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.