Efter lite hjälp på Pellesoft blev lösningen så här
Private Function SammaSpelare() As Boolean
Dim ValdaSpelare(21) As String
Dim c As Control
Dim c1 As Control
Dim c2 As Control
Dim i, j As Integer
For Each c In tblAPlayers.Controls
If LCase(c.GetType.ToString) = "system.web.ui.webcontrols.tablerow" Then
For Each c1 In c.Controls
If LCase(c1.GetType.ToString) = "system.web.ui.webcontrols.tablecell" Then
For Each c2 In c1.Controls
If LCase(c2.GetType.ToString) = "system.web.ui.webcontrols.dropdownlist" Then
Dim cbo As DropDownList
cbo = c2
ValdaSpelare(i) = cbo.SelectedItem.Value
i += 1
End If
Next
End If
Next
End If
Next
For i = 0 To ValdaSpelare.Length - 1
For j = i + 1 To ValdaSpelare.Length - 1
If ValdaSpelare(i) = ValdaSpelare(j) And Not ValdaSpelare(i) = "0" And Not ValdaSpelare(i) = Nothing Then
Return True
End If
Next
Next
Return False
End Function
134 ms totalt · 3 externa anrop · v20260731065814-full.4bcf49fe