I am writing a small Windows Forms application in C#. Basically, it will ask the user a series of questions in a step-by-step format. I would like to have a new form for each “step,” so my question is: Is there a standard logical way of doing this?
Right now, what I am doing is making a class which holds an instance of each different form. I have “next” and “previous” buttons which allow the user to go back and forth by using “show()” and “hide()” commands for the different forms.
Some problems I’m having:
-I want the forms to pop up in the exact same location as the previous one (right now it is a bit skewed)
-I’m afraid that my method of implementation is not the best. This is a fairly common thing to do, so I’m sure there are accepted procedures.
I’m just looking for some insight from people more experienced than me. I’ll appreci
For example…
The user opens the program.
The first screen asks them to choose a date. User chooses date and clicks “next.”
The first screen closes and the next screen opens.
The second screen asks the user to choose a file. User chooses file and clicks “next.”
Etc.
Thanks!
Edit: To further clarify…install screens are very similar to what I want.
There are a few wizard control components out there that will allow you to do this, or you can build your own.
For a very good free wizard control, see here: http://www.codeproject.com/KB/miscctrl/DesignTimeWizard.aspx
To grow your own is relatively simple to do, but tedious. I’d recommend looking at the one I posted, examining the code, and if it won’t work as-is, it does have a good design that you can learn from in deciding how to build your own.
In essence, though, you really don’t want to do different forms. That’s got to be a nightmare.
You should instead be using one form and having different panels on the form that are shown an hidden as necessary.