D
Dan Keeley
Hi
I'm trying to create a custom combo box so i can display a nice text name
but return the actual key value for the database.
So i have this class ( At the bottom of this post )
How do i get the current value?
I have customerlist which is a "comboitem2". The user has selected an item,
but when i ask for customerlist.OptionValue it returns zero...
Have i missed a step somewhere?
Thanks!
Dan
Public Class ComboItem2
Inherits ComboBox
Private m_strName As String
Private m_intAge As Integer
Public Shadows Property Name() As String
Get
Return m_strName
End Get
Set(ByVal Value As String)
m_strName = Value
End Set
End Property
Public Property OptionValue() As Integer
Get
Return m_intAge
End Get
Set(ByVal Value As Integer)
m_intAge = Value
End Set
End Property
Public Overrides Function ToString() As String
Return m_strName & " (" & m_intAge.ToString() & ")"
End Function
End Class
I'm trying to create a custom combo box so i can display a nice text name
but return the actual key value for the database.
So i have this class ( At the bottom of this post )
How do i get the current value?
I have customerlist which is a "comboitem2". The user has selected an item,
but when i ask for customerlist.OptionValue it returns zero...
Have i missed a step somewhere?
Thanks!
Dan
Public Class ComboItem2
Inherits ComboBox
Private m_strName As String
Private m_intAge As Integer
Public Shadows Property Name() As String
Get
Return m_strName
End Get
Set(ByVal Value As String)
m_strName = Value
End Set
End Property
Public Property OptionValue() As Integer
Get
Return m_intAge
End Get
Set(ByVal Value As Integer)
m_intAge = Value
End Set
End Property
Public Overrides Function ToString() As String
Return m_strName & " (" & m_intAge.ToString() & ")"
End Function
End Class