Function GetPrice(ByVal key As String) As Decimal
Dim priceTable As New Dictionary(Of string, Decimal)()
priceTable.Add("chair", 10.0)
priceTable.Add("table", 40.0)
Return If(priceTable.ContainsKey(key), priceTable(key), 0)
End Function
Public Sub Button1_click(ByVal sender As Object, ByVal e As EventArgs)
ListBox1.Items.Add(GetPrice(Textbox1.Text).ToString())
End Sub