I have two combobox. I want to transfer all elements from combo1 to combo2 but with a filter only those item from combo1 will go to combo2 which are not in combo2.

For example

Combo1
________
This
Is
Help
But
Not

Combo2
_______
Is
But
And
Quick

So after clicking a button

Combo1
________
Is
But

Combo2
______
Is
But
And
Quick
This
Help
Not


Please help me......

Try this

Dim j As Integer = 0
        While j <= Me.ListBox1.Items.Count - 1


            Dim i As Integer = 0

            For i = 0 To Me.ListBox2.Items.Count - 1
                If Me.ListBox1.Items(j) = Me.ListBox2.Items.Item(i) Then
                    Exit For
                End If
            Next

            If i = Me.ListBox2.Items.Count Then
                Me.ListBox2.Items.Add(Me.ListBox1.Items.Item(j))
                Me.ListBox1.Items.RemoveAt(j)
            Else
                j += 1
            End If

        End While

I see in your code that you use ListBox1 instead of ComboBox1

I replace that on my own and its working.. is that ok??

This question has already been answered. Start a new discussion instead.