Dim buttonList As New List(Of Button) Private Sub buttons_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles b1.Click, b4.Click, b5.Click, b8.Click Dim selectedBtn As Button = sender buttonList.Add(selectedBtn) End Sub Public Sub checkitems() For Each b As Button In buttonList If b.BackColor.Equals(buttonList(3).BackColor) AndAlso buttonList(3).BackColor = Color.Red Then Label5.Text += 1 Else Label6.Text += 1 End If Next End Sub
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)