VB Listbox change value
How can i change a value in a VB Listbox?
Like this it doesn't work:
listbox.selectedItem = "Newvalue"
THX fo开发者_开发百科r help
listbox.List(listbox.ListIndex) = "NewValue"
Adding items to listbox:
ListBox1.Items.Add("AA")
ListBox1.Items.Add("BB")
ListBox1.Items.Add("CC")
ListBox1.Items.Add("DD")
now select anyone 1 option in the listbox:
Add this code in your button click
ListBox1.SelectedItem.Text = "newvalue"
the selected option/value "CC" is changed to "newvalue"
精彩评论