How to select all duplicates for the selected item in a listbox ?

  • Thread starter Thread starter Mostafa Salaheldien
  • Start date Start date
M

Mostafa Salaheldien

Guest
hello everyone,

iam using this code for select all the duplicates in listbox but what i need here i want to check duplicate for the item i select

Dim duplicates = Listrate.Items.OfType(Of String).
Select(Function(currentItem, index) New With {
Key .Index = index,
Key .Text = currentItem}).
GroupBy(Function(g) g.Text).Where(Function(g) g.Count() > 1)


For Each topItem In duplicates
For Each value In topItem
Listrate.SetSelected(value.Index, True)
Next
Next

Continue reading...
 

Similar threads

Back
Top