For now I have created a Windows Forms Project with a single form and six buttons added. What I want to do right now is find out how I can iterate through all my buttons and the goal is to set the background color of every button with an even number a different color. Like – button1 - white, button2-red, button3-white, button4-red and so on. Right know I don’t know either how to iterate the buttons or change the background color property but the questions is about iterating so I’d appreciate help about this topic if someone knows how to change the background color of the button it will save me time and maybe new question here.
For now I have created a Windows Forms Project with a single form and
Share
Is it an array or list of buttons? Then you could do: