全部的代码如下:
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
ListBox1.Items.Clear()
ListBox2.Items.Clear()
ListBox3.Items.Clear()
For i As Short = 1001 To 1005
ListBox1.Items.Add(i)
Next
For i As Short = 1002 To 1003
ListBox2.Items.Add(i)
Next
For Each i As Integer In ListBox1.Items
Dim same As Boolean = False
For Each j As Integer In ListBox2.Items
If i = j Then
same = True
Exit For
End If
Next
If Not same Then
ListBox3.Items.Add(i)
End If
Next
End Sub
End Class