System.StackOverflowException when two scripts of a project create instances of each other

32 Views Asked by At

https://i.stack.imgur.com/mLFFw.jpg ^ MainMenu script needs to call the LogIn script to show LogIn form.

https://i.stack.imgur.com/ZIfpM.jpg ^ LogIn script needs to call MainMenu script to:

mainmenu.lblTitle.Text = username;

I've created an instance of LogIn so I can open LogIn's form in a new window when I click a button. Then once I've entered the username and password and click a button, the LogIn script needs to call the MainMenu script to change the text on one of its form's labels.

I'm a beginner at C#

0

There are 0 best solutions below