Hi,
I have the following form onload event to populate my combobox:
ComboBox1.Items.Add(New ValueDescriptionPair(1, "test1"))ComboBox1.Items.Add(New ValueDescriptionPair(2, "test2"))
ComboBox1.Items.Add(New ValueDescriptionPair(3, "test3"))
I can get the text of the selected item of the combobox:
ComboBox1.SelectedText.ToString
But I can't get the value of the selected item
ComboBox1.SelectedValue.ToString
and here is my class:
Public Class ValueDescriptionPairPublic Value As Object
Public Description As String
Public Sub New(ByVal NewValue As Object, ByVal NewDescription As String)
Value = NewValue
Description = NewDescription
End Sub
Public Overrides Function ToString() As String
Return Description
End Function
End Class
what am I doing wrong?
Thanks