thanks a lot for the answer but I really couldn't understand many of it's expressions.
I googled it but all I found was VB code.
and about the idea you provided above, I tried it but it gives me an out of range exception.
here is what I did so far:
int L = listBox1->Items->Count::get();
int i = 0;
while(i<l)>
{
i++;
for(int k=0; k<l;>
{
if(listBox1->Items[i]==listBox1->Items[k])
{
listBox2->Items->Add(listBox1->Items[i]);
}
}
}
Sorry if I were wrong!