开发者

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:

VB Listbox change value

Add this code in your button click

ListBox1.SelectedItem.Text = "newvalue"

VB Listbox change value

the selected option/value "CC" is changed to "newvalue"

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜