vb.net中怎样把listbox1中选中的内容增加到listbox2中
请教各位:中怎样把listbox1中选中的内容增加到listbox2中
Dim i, j As Integer
Dim zjbd As Boolean
zjbd = False
If ListBox1.SelectedIndex = -1 Then Exit Sub
For i = 0 To ListBox1.Items.Count - 1
If ListBox1.GetSelected(i) = True Then
For j = 0 To ListBox2.Items.Count - 1
If ListBox1.Items(i) = ListBox2.Items(j) Then
zjbd = True
End If
Next
If zjbd = False Then ListBox2.Items.Add(ListBox1.Items(i))
zjbd = False
End If
Next