I'm a first year student in university and i'm in the process of learning Visual Studio and I'm trying to build a Quiz.
The quiz has 10 questions - Created in 10 different forms Each form design also has panel with 10 radio buttons (labeled Question 1 - Question 10) when a radio button is selected i.e. Question 2, will hide the existing form, and open up the form2 which is for Question 2. Each form design has the buttons NEXT, PREVIOUS and SUBMIT.
- Hitting NEXT will go to the next question (i.e. if currently on form 1 next will go to form 2 and so on.)
- The SUBMIT button will only be enabled AFTER all 10 questions have been answered, and will go to FORM 11 (Summary of Quiz).
I'm having a problem here. The intended outcome should be:
- When Hitting PREVIOUS button, it should open the last form hidden.
I've only come across ways to use a button to go to specific forms that have been defined, but is there a way that the button is able to identify the last form opened?
i.e. Using this code, when I click the button, it hides the current form, and shows a specific form that has been defined. But I can't use this for the outcome I want.
Form1.Hide() Form2.Show()
Intended Outcome
- i.e. I start the application, it's in form 1. I select Radio Button with label Question 9, where it hides form 1 and opens form 9 (Question 9)
- I select Radio Button with label Question 5, it hides form 9 (Question 9) and opens form 5 (Question 5).
- When I hit PREVIOUS, I want it to hide form 5 (Question 5) and open the last form hidden which is form 9 (Question 9).
- From Question 9, when I hit PREVIOUS, it hides Question 9 and goes back to Question 1 (Form 1)
Would very much appreciate assistance on this. Thanks!