Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Drawing;
- using System.Windows.Forms;
- namespace WindowsFormsApplication3
- {
- public partial class Form1 : Form
- {
- private readonly Button[] buttons;
- private int current;
- public Form1()
- {
- InitializeComponent();
- buttons = new[]
- {
- button1, button2, button3, button4,
- button5, button6, button7, button8,
- button9, button10, button11, button12
- };
- }
- private void timer1_Tick(object sender, System.EventArgs e)
- {
- if (current >= buttons.Length)
- current = 0;
- var button = buttons[current];
- button.BackColor = button.BackColor == Color.LightGreen ? Color.Yellow : Color.LightGreen;
- current++;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement