2
Is there any way I can put the items in one Array without multiplying them? I am trying the following. I want to add the list items MethodList on the list toAdd, but without repeating what is on the list sourceItems:
For Each iKey As String In MethodList
For Each d As AutocompleteItem In mMenu.Items.sourceItems
If Not (d.Text = iKey) Then ' Verifica se o item não existe na lista
toAdd.Add(New AutocompleteItem(text:=iKey, 7))
End If
Next
Next
But it’s not working, it’s showing like this on the list toAdd:
MeuObjeto
MeuObjeto
MeuObjeto
MeuObjeto
MeuObjeto
....
and repeating them endlessly, I want to make sure you don’t have the same object on the list.
You can do something like this:
If Not (mMenu.Items.sourceItems.contains(iKey)) Then– stderr
Doesn’t work.
sourceItemsis a list of Autocompleteitem, the objectiKeyis a String, would give a conflict.– CypherPotato