Jump to content
Xtreme .Net Talk

Recommended Posts

Posted (edited)

Lets say I have two forms that I wish to switch back and forth from, until the user is ready to go on to a 3rd Form

 

(My program acts sort of like a wizard)

 

So,

In Form1 I have button which

 

Dim frm2 as New Form2()
Form2.Show
Me.Hide

 

now that I am on Form 2, how to I get back to Form1 from Form2, with all the text boxes still holding the values before I called the Me.Hide method?

 

Thanks!

 

p.s. a thought occured to me, could I pass the form to the next forms constructer? Should I create a Class that houses all my forms as properties? (is that possible?)

Edited by melegant
Posted

I'd chose the way of creating a "WizardManager" class.

 

All of your forms 1 .. n would implement an interface IWizardMember, i.e. a show and a hide method, some events (movenextpressed, movebackpressed, cancelpressed, finishpressed).

 

The WizardManager could keep a list of the forms 1..n, react to the events thrown and make calls to the forms' IWizardMember Interface.

.nerd

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...