I am trying to do this array in C# WPF. On this part of the code:
buttons[1, 0] = button2x1;
It throws :
System.IndexOutOfRangeException error.
But I don´t think that is out of range. What is going on?
buttons = new Button[2, 2];
buttons[0, 0] = button1x1;
buttons[0, 1] = button1x2;
buttons[0, 2] = button1x3;
buttons[1, 0] = button2x1;
buttons[1, 1] = button2x2;
buttons[1, 2] = button2x3;
buttons[2, 0] = button3x1;
buttons[2, 1] = button3x2;
buttons[2, 2] = button3x3;