Here is another option and is case insensitive
Public Class Form1
Private ReadOnly LabelList As New List(Of Label)
Private Sub Form1_Shown(sender As Object, e As EventArgs) Handles Me.Shown
LabelList.AddRange(New Label() _
{
Label1,
Label2,
Label3,
Label4,
Label5,
Label6
})
End Sub
Private Sub WorkButton_Click(sender As Object, e As EventArgs) Handles WorkButton.Click
If LabelList.Any(Function(currentLabel) ItemTextBox.Text.Equals(currentLabel.Text, StringComparison.CurrentCultureIgnoreCase)) Then
LabelList.ForEach(
Sub(label)
If label.Text.Equals(ItemTextBox.Text, StringComparison.CurrentCultureIgnoreCase) Then
label.ForeColor = Color.Red
End If
End Sub)
End If
End Sub
End Class
Update
Using case insensitive compare
Public Module StringExtensions
<Runtime.CompilerServices.Extension>
Public Function ContainsInsensitive(source As String, toCheck As String) As Boolean
Return source.IndexOf(toCheck, StringComparison.OrdinalIgnoreCase) >= 0
End Function
End Module
Form code
Public Class Form1
Private ReadOnly LabelList As New List(Of Label)
Private Sub Form1_Shown(sender As Object, e As EventArgs) Handles Me.Shown
LabelList.AddRange(New Label() _
{
Label1,
Label2,
Label3,
Label4,
Label5,
Label6
})
End Sub
Private Sub WorkButton_Click(sender As Object, e As EventArgs) Handles WorkButton.Click
If LabelList.Any(Function(currentLabel) currentLabel.Text.ContainsInsensitive(ItemTextBox.Text)) Then
LabelList.ForEach(
Sub(label)
If label.Text.ContainsInsensitive(ItemTextBox.Text) Then
label.ForeColor = Color.Red
End If
End Sub)
End If
End Sub
End Class