Advertisement
Guest User

Untitled

a guest
Nov 30th, 2015
20
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.78 KB | None | 0 0
  1.         private void Transition(Color newColor, bool forward=true)
  2.         {
  3.            
  4.             for (uint c = 0; c < Constants.MaxColumns; c++)
  5.             {
  6.                 for (uint r = 0; r < Constants.MaxRows; r++)
  7.                 {
  8.                     var row = (forward) ? r : Constants.MaxRows - r - 1;
  9.                     var col = (forward) ? c : Constants.MaxColumns - c - 1;
  10.                     Keyboard.Instance[row, col] = newColor;
  11.                 }
  12.                 Thread.Sleep(50);
  13.             }
  14.         }
  15.  
  16.  
  17.         private void button1_Click(object sender, EventArgs e)
  18.         {
  19.  
  20.             Transition(Color.Red);
  21.             Transition(Color.Green);
  22.             Transition(Color.Red, false);
  23.             Transition(Color.Green, false);
  24.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement