Somehow I find it really hard to believe that you cannot translate the pseudo code I mentioned above into VB syntax......
Here is an example of the pseudo code that mentioned above.
It is not guaranteed to work because I haven't tested it.
-
Dim theTextToLookFor As String = theLabelToCheck.Text
-
Dim theLabelsFound As List(Of Integer) 'Will contain all of the indexes of the labels whose text matches the one you're checking
-
-
For index As Integer = 0 to myArrayOfLabels.Length
-
Dim lbl As Label = myArrayOfLabels(index)
-
If String.Compare(theTextToLookFor,lbl.Text,True)=0 Then
-
theLabelsFound.Add(index)
-
End If
-
Next
-
-
'Now you need to process the Labels that you've found.
-
'I *Think* you're going to have to put this whole section of code within another loop so to loop through each label in the array and check for duplicates...I think...
-
-
Try implementing this solution.
If it doesn't do exactly what you want it to do (which I'm guessing that it wont) think about how you can modify the code to do what you want it to do...give that a try...and then if you are still having difficulties post the code that you have tried so that we can see what you are doing. We can't help you if you simply say "I tried something but it doesn't work"...you need to provide details on why it doesn't work and, to make it even more clear, you should post the snippet of code that you are having difficulties with.
Please do not post all of your code because this makes it hard for us to find exactly what you're talking about. Just post the code that you are having difficulties with.
Also please remember to use
code tags when posting code snippets.
-Frinny