Question Stack Overflow Exception

Gears1324

Member
Joined
May 17, 2016
Messages
11
Programming Experience
Beginner
Hi everyone. Admittedly I am new with programming but I am learning.
Anyway, I am currently doing a project for school which needs multiple screens to be linked and switch to the next screen after a certain action is performed. I have been trying to get the first screen to load, click the button, then display the 2nd screen while hiding the 1st screen. Currently I am stuck with a System.StackOverflowException unhandled exception and currently I have been unable to fix it. Also I am currently using Visual Studio 2015.
Here is my code:

public
partial class Form1 : Form

{


public Form1()

{

InitializeComponent();

}



private void button1_Click(object sender, EventArgs e)

{



}



public void Form1_Load(object sender, EventArgs e)

{


var blah = 1;


List<int> aList = new List<int>();

aList.Add(0);

aList.Add(0);

aList.Add(0);

aList.Add(0);

aList.Add(0);

aList.Add(0);

aList.Add(0);

aList.Add(0);

aList.Add(0);

aList.Add(0);


for (int i = 0; i < 10; i++)

{

aList = (blah * 5);



Console.WriteLine("Array List = " + aList + " : Loop number = " + i + " : var number = " + blah);


blah += 1;

}

}




Form1 form1 = new Form1();


Form2 form2 = new Form2();





private void button1_Click_1(object sender, EventArgs e)

{

form2.Show();

form1.Hide();

}

}

}

Thanks
 
I just tried with your tags and that's how it turned out.

This will be my last post to this thread. I told you, repeatedly, that you need to post your code as plain text, NOT as HTML, and you need to post it within XCODE tags. You need to do both at the same time, yet you repeatedly DO NOT do that. Your latest attempt is yet again HTML. I'm done wasting my time on this.
 
Back
Top Bottom