B
Bruce D
I'm confused on the best way to create a combobox with "YES"/"NO" and values
of "Y""/N". I'm trying this way...but I get an error: Could not bind to the
new display member
Public Class combo
Inherits System.Windows.Forms.Form
Public Structure sItems
Public DisplayVal As String
Public RealVal As String
End Structure
Dim arlist As ArrayList
Dim sList As sItems
Private Sub combo_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
arlist = New ArrayList
sList = New sItems
sList.DisplayVal = "Yes"
sList.RealVal = "Y"
arlist.Add(sList)
sList.DisplayVal = "No"
sList.RealVal = "N"
arlist.Add(sList)
Me.ComboBox1.DataSource = arlist
Me.ComboBox1.DisplayMember = "DisplayVal"
Me.ComboBox1.ValueMember = "RealVal"
End Sub
End Class
Any help is appreciated!
-BD
of "Y""/N". I'm trying this way...but I get an error: Could not bind to the
new display member
Public Class combo
Inherits System.Windows.Forms.Form
Public Structure sItems
Public DisplayVal As String
Public RealVal As String
End Structure
Dim arlist As ArrayList
Dim sList As sItems
Private Sub combo_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
arlist = New ArrayList
sList = New sItems
sList.DisplayVal = "Yes"
sList.RealVal = "Y"
arlist.Add(sList)
sList.DisplayVal = "No"
sList.RealVal = "N"
arlist.Add(sList)
Me.ComboBox1.DataSource = arlist
Me.ComboBox1.DisplayMember = "DisplayVal"
Me.ComboBox1.ValueMember = "RealVal"
End Sub
End Class
Any help is appreciated!
-BD