Exforsys
+ Reply to Thread
Results 1 to 2 of 2

Counting identical items in listbox

This is a discussion on Counting identical items in listbox within the Microsoft .NET forums, part of the Programming Talk category; Is there a way to count identical items in a listbox ? VB 2005.net...

  1. #1
    Fatboy58 is offline Fatboy58 Array
    Join Date
    Mar 2008
    Location
    Europe
    Answers
    1

    Counting identical items in listbox

    Is there a way to count identical items in a listbox ?

    VB 2005.net


  2. #2
    Guptha_S is offline Member Array
    Join Date
    Jan 2006
    Answers
    46
    Yes create another temp list box and add each item form actual list box to temp list box, before add check if the item is already present or not


    For Each xitem In Me.somelist
    If NOT (Me.templist.Items.Contains(xitem.someitemdata)) Then
    Me.templist.Items.Add(xitem.someitemdata)
    End If
    Next

    later on you can cleanup actual list and load items from temp list, keeping temp list invisible all the while

    This may not be optimal method, I have given you just a method


Latest Article

Network Security Risk Assessment and Measurement

Read More...