Hopping from form to form

Hello,

i want to make a simple forms application in c#. As the most work i do
is programming for the www I want to know how i can manage to make
a sort of application consisting of a few forms which show as the previous form
is closed. Just like a web-application posting some variables to the next page.

I need this for a sort of signup-tool with a touchscreen. Can anybody give me a clue
how to realize this.

With kind regards
Joris
[483 byte] By [Jeversen] at [2007-11-19 10:51:28]
# 1 Re: Hopping from form to form
Hi Joris,
You can create your own properties to pass on values from one form to another.
You could also override the default constructor of the Form to pass values..

I have attached a sample that has two forms and the first form sets the properites of the next form..

Take a look
Shuja Ali at 2007-11-9 1:49:32 >
# 2 Re: Hopping from form to form
A simple, forward only style navigation between forms could be implemented by:

1. Each form (except start form I guess) takes the required parameters in the constructor.

2. Each form (except end form I guess) upon next event (e.g. button click), creates the next form, passing the required parameters in the constructor, and the closes itself.

Backward/forward can easily be added by:

3. Each form (except start form) takes previous form as a parameter in constructor

4. Data is passed in a method instead of a constructor.

5. Instead of closing itself upon next each form hides itself and shows next form, and calls data passing method of next form

6. For each form (except start form), when previous event happens, it shows previous form and then hides itself.

7. All forms are constructed at once, but only first form is shown.
klintan at 2007-11-9 1:50:35 >
# 3 Re: Hopping from form to form
I would do it in a different way. If you have a look how wizards works, you will see that there is only one Form. Inside of this form you have an active panel and at the bottom a few buttons for navigating. I think it is easier to manage, because you do not have to pass the values from one form to another, because all informations are inside of one form. Additional you can easy navigate forwards or backwards by simply switching the active panel. And at least there are many user controls out there, that gives you such a wizard container and you have only to develope the content of the different panels.

Because I use the dotnetmagic library in general I use the wizard inside of it, but I found also a few other implementations by using google.
torrud at 2007-11-9 1:51:40 >
# 4 Re: Hopping from form to form
I would do it in a different way. If you have a look how wizards works, you will see that there is only one Form. Inside of this form you have an active panel and at the bottom a few buttons for navigating. I think it is easier to manage, because you do not have to pass the values from one form to another, because all informations are inside of one form. Additional you can easy navigate forwards or backwards by simply switching the active panel. And at least there are many user controls out there, that gives you such a wizard container and you have only to develope the content of the different panels.

Because I use the dotnetmagic library in general I use the wizard inside of it, but I found also a few other implementations by using google.I totally agree with torrud.
His way is a much better and easier way of doing this.

Edit--
How pity i can't rate torrud's post right now..
Shuja Ali at 2007-11-9 1:52:45 >