cboT1_PayRate.BeginUpdate()
cboT1_PayRate.Items.Clear()
cboT1_PayRate.Items.Add(New ListBoxItem("AN", "Annually"))
cboT1_PayRate.Items.Add(New ListBoxItem("HR", "Hourly"))
cboT1_PayRate.Items.Add(New ListBoxItem("WK", "Weekly"))
cboT1_PayRate.EndUpdate()
....
Public Class ListBoxItem
Private listItemData As Object ' make this whatever datatype most
appropriate for you
Private listItemText As String
' This is what is displayed in the ComboBox drop-down
Public Overrides Function ToString() As String
Return listItemText
End Function
Public Sub New(ByVal itemData As Object, ByVal itemText As String)
listItemData = itemData
listItemText = itemText
End Sub
Public ReadOnly Property Data() As Object
Get
Data = listItemData
End Get
End Property
Public ReadOnly Property Text() As String
Get
Text = listItemText
End Get
End Property
End Class
HTH,
Greg
"BrianDH" <Br*****@discussions.microsoft.com> wrote in message
news:48**********************************@microsof t.com...
Is there a way to load into a listbox..
one click at a time...
one row at a time...
both a value & display text without using a bound Dataset?
ValueID = 123
DisText = "Bob"
Private Sub btnSplitAdd_Click(ByVal sender As System.Object, ByVal e As _
System.EventArgs) Handles btnSplitAdd.Click
lbSplitBrkFee.BeginUpdate()
lbSplitBrkFee.Items.Add(ValueID, DisText)
lbSplitBrkFee.EndUpdate()
End Sub
User will only see "Bob", but when they click on the listbox I can get
access to the ValueID 123
Thanks
Brian