I have an rpg game that I have been working on for a while, and I cannot seem to get lists set up. I had different classes for different equipment I wanted to use, and I found it hard to set up the lists in those classes, then call it from a different class, to a combobox in my form. So I decided to start from scratch and maybe ask a question about it, so I deleted all the lists, and tried to run the program. For some reason, on my create a character screen I called `

this.Hide();
HomeScreen next = new HomeScreen();
next.ShowDialog();
this.Close();

But for some reason when I run my program and create a character, it is supposed to go to the next form, which is the HomeScreen(), but it returns "System.NullReferenceException". I beleieve for some reason it is nullifying my variables then trying to call HomeScreen(). I am not sure why this is happening, because it did not happen before. Also as I stated before I tried to make a class called Head.cs that I tried to add test head items to add to a combobox, and that never worked for me :( If you also had some insight to that it would be most appreciated!

I've included a zip with just the bare minimum, but I guess it will show you a mechanism on how to get two forms on speaking terms.
Good luck!
If still in trouble, just ask.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.