How do you ‘do something’ to every element in a list except that one index? (C# Beginners Level Question) [closed]

I created a list of 40 buttons, each of these buttons have an ‘int counter’ that counts up incrementally to 5 whenever pressed.

If I hit button 1, the other button’s counter will reset and become 0, but the button I hit can now increase to 2, 3, 4, 5.

How would you loop the list in a way that doesn’t also reset the button being pressed?

Button itself is a class, and I have a ButtonManager that contains List< Button > Buttons