I would like to know, how I can sent the listbox items from one listbox ("LIST1") to another listbox ("LIST2") and clear the selected items from list1?
Printable View
I would like to know, how I can sent the listbox items from one listbox ("LIST1") to another listbox ("LIST2") and clear the selected items from list1?
Code:Private Sub Command1_Click()
For i = 0 To List1.ListCount - 1
List2.AddItem List1.List(i)
Next i
End Sub
for removing selected items
Code:Sub ListBoxRemSel(lst As ListBox)
Do Until lst.SelCount = 0
If lst.Selected(a) Then lst.RemoveItem a: a = a - 1
a = a + 1
Loop
End Sub
Private Sub Command1_Click()
Call ListBoxRemSel(List1)
End Sub
Here is the code I have corrected
Code:Private Sub List1_DblClick()
On Error Resume Next
List2.AddItem List1.Text
List1.RemoveItem List1.ListIndex
End Sub
Private Sub List2_DblClick()
On Error Resume Next
List1.AddItem List2.Text
List2.RemoveItem List2.ListIndex
End Sub
U said that u want to send items to list2. U did not say that i want it when i doubleclick it. Anyway ur prob is solved.