'The structure:
Public Structure PriceInfo
Public Size As String
Public Price As Integer
End Structure
'The array to hold the various possible combinations:
Private PriceInfos(2) As PriceInfo
'Populate the array with its values on load:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
PriceInfos(0).Size = "Small"
PriceInfos(0).Price = 7
PriceInfos(1).Size = "Medium"
PriceInfos(1).Price = 9
PriceInfos(2).Size = "Large"
PriceInfos(2).Price = 11
End Sub
'Handle the event of the combobox selected index changed:
Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
Dim currentSize As String = ComboBox1.Text
For i As Integer = 0 To 2
If PriceInfos(i).Size = currentSize Then
MsgBox(PriceInfos(i).Price)
Exit For
End If
Next
End Sub