An object reference is required for the non-static field, method, or property. c#
<p>I just want to have form1 detect the color of the border on form2 but i get the error "An object reference is required for the non-static field, method, or property." Any help is appreciated. (C#)</p>

<p>&lt;----Form1----></p>

<pre><code>    private void Form1_Load(object sender, EventArgs e)
    {

                if (Form2.pnlBorder.BackColor = Color.Yellow)
                {
                    MessageBox.Show("Trial Active");
                }
                else
                {
                    MessageBox.Show("Trial Expired");


                    using (Form2 ac = new Form2())
                    {
                        this.Hide();
                        if (ac.ShowDialog() == DialogResult.OK)
                        {
                            this.Show();
                        }
                        else
                        {
                            this.Close();
                        }
                    }
                }
            }


    private void button1_Click(object sender, EventArgs e)
    {                      

        new Form2().Show();

    }

}
</code></pre>

<p>}</p>

<p>&lt;---- Form2----></p>

<pre><code>public partial class Form2 : Form
    {
        public Form2()
        {
            InitializeComponent();
            pnlBorder.BackColor = Color.Yellow;
            pnlBackground.BackColor = Color.FromArgb(255, 255, 192);
        }
    }
}
</code></pre>
