What is equivalent of Combobox.ItemData property?

  • Thread starter Thread starter Muhammad Mudasar Ansari
  • Start date Start date
M

Muhammad Mudasar Ansari

Hi all

what is the equivalent of ItemData property ib .net framework..
is it ValueMember. ? but it does not allow me to set value with out a data
source..
I want to set values with out using data source..

any suggestion?

Ansari
 
H

As far as I know, In windows forms, the ValueMember of a Combobox can be set only by setting the DataSource property of the same

Sooraj P
Microsoft India Community Star
 
* "Muhammad Mudasar Ansari said:
what is the equivalent of ItemData property ib .net framework..
is it ValueMember. ? but it does not allow me to set value with out a data
source..
I want to set values with out using data source..

\\\
Dim p As Person = New Person()
p.Name = "Pink Panther"
p.Age = 22
Me.ListBox1.Items.Add(p)
..
..
..
Public Class Person
Private m_strName As String
Private m_intAge As Integer

Public Property Name() As String
Get
Return m_strName
End Get
Set(ByVal Value As String)
m_strName = Value
End Set
End Property

Public Property Age() 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
///
 
Back
Top