So for a coding project I need to create an Othello game. Now I'm trying to do most of it on my own. Basically trying to re-learn C#. I'm just trying to create a board. Now I am using textboxes and B represents black and W represents a white piece.
My problem is trying to create my board class.
My code here:
private TextBox[,] textboxes;
public board()
{
textboxes = new TextBox[,] {
{textBox1,textBox2,textBox3,textBox4,textBox5,textBox6,textBox7,textBox8},
{textBox11,textBox12,textBox13,textBox14,textBox15,textBox16,textBox17,textBox18},
{textBox21,textBox22,textBox23,textBox24,textBox25,textBox26,textBox27,textBox28},
{textBox31,textBox32,textBox33,textBox34,textBox35,textBox36,textBox37,textBox38},
{textBox41,textBox42,textBox43,textBox44,textBox45,textBox46,textBox47,textBox48},
{textBox51,textBox52,textBox53,textBox54,textBox55,textBox56,textBox57,textBox58},
{textBox61,textBox62,textBox63,textBox64,textBox65,textBox66,textBox67,textBox68},
{textBox71,textBox72,textBox73,textBox74,textBox75,textBox76,textBox77,textBox78}};
}
This creates an 8x8 grid of boxes. I have this in a class named board. It won't let me use these textboxes here.
I get this error: Error 1 Cannot access a non-static member of outer type 'WindowsFormsApplication1.Form1' via nested type 'WindowsFormsApplication1.Form1.board'
Any thoughts or ideas how to make this easier then I am doing it?