I am writing a program for a class (group project) that is a math quiz game for students. Each form is a new question so I have forms named Question1.cs, Question2.cs, etc.
There are three choices and if the user selects the right choice, its easy enough to close/hide the current form and load the next. However, I would like to make a global form for wrong answers. If I make one form for a wrong answer I only know how to create an event that loads a certain form type, ie if it was wrong on question two the code would say in the button click event on the wrong.cs form:
Question2 Q2 = new Question2();
Q2.show();
this.hide();
But if I wanted to use that same wrong.cs form for a different question, thats where my problem is. I know a decent amount of C++ and general programing concepts so I know what I need to do, but I am not familiar enough with C# yet to do too much. My teacher told us for the sake of her not knowing enough to just make a new form for each wrong question however I don't want to have it taking up all that space and just know how to make an overall better program with a single universal wrong form.
I was thinking about making a global pointer, and when a student clicks a wrong answer, set that pointer to the current form, then when the wrong form loads, and you click back to the previous form, have it load that form that that pointer is pointing to.
But I tried that with the little knowledge that I have and I figured that a pointer of type Form1 is completely different from a pointer of type Form2. How would I get around this?