vb: how to replace listbox item?
This site provides users with the information about vb, visual basic, vb6, replace listbox item, how to replace listbox item, and more. |
If you think that this site is helpful, please recommend your friends to visit our site.
How to replace listbox item?
The following is the code for how to replace listbox item with text in the textbox:
Dim t As Integer
Private Sub Command1_Click()
List1.AddItem Text1.text, t
Private Sub Form_Load()
Private Sub List1_Click()
t = List1.ListIndex
When you click the listbox item, you get the index of the listbox and with the index, when you click the command button, the item with the index is deleted and the text in the textbox is added, also with the same index. As a result, the item in the listbox is replaced by the text in the textbox.