tags:

views:

9

answers:

2

Hello,

I would like to ask what is the best way to implement functionality that:

User has for example 3 buttons on the main form, if he clicks on any button the form is replaced with another one where he has to fill some textcontrolls and after clicking accept redirect him to the main form.

Is it done by using visible and swithing it ?

I hope there is much cleaner solution

thanks for help, bye

+1  A: 

It's essentially using the visible property of the form, but using the Form.Show() method to show the second form.

Form.Show() as far as I know is just a wrapper to changing the Visible property of the form.

Jaymz
+1  A: 

I'm going to assume VB.net on this one.

You'll need to create four different forms, Form1, Form2, Form3, Form4, etc. Form1 has the buttons on it, and each other Form (2,3,4) has the text fields on it with OK buttons which will close the forms.

So, for each button in Form1:

dim tempForm as Form2 = new Form2
tempForm.showModal()  ' might be .showDialog()

And for each button in Form2,3,4

me.hide  'might be this.hide

Sorry, I get my languages mixed up sometimes :P

Jeffrey Kern