Switching Between Forms

  • Thread starter Thread starter Gordon Padwick
  • Start date Start date
G

Gordon Padwick

I'm struggling to become familiar with WPF.

What I'm trying to do should, I think, be basic, but it doesn't seem to be
covered in Help or the several WPF books I have.

I've created a basic form and eight subsidiary forms. The basic form
contains eight buttons. I want a user to be able to click a button on the
basic form to open one of the subsidiary forms.

How do I do that?

Gordon
 
I'm struggling to become familiar with WPF.

What I'm trying to do should, I think, be basic, but it doesn't seem to be
covered in Help or the several WPF books I have.

I've created a basic form and eight subsidiary forms. The basic form
contains eight buttons. I want a user to be able to click a button on the
basic form to open one of the subsidiary forms.

How do I do that?

In the button click event you would instantiate an object of the form
you want to open:

FormName myForm = new FormName();

and then you would show it, usually with the ShowDialog method:

myForm.ShowDialog();

Yes, this is very basic stuff.
 
Got that and now see how it works.
Thanks
G
I'm struggling to become familiar with WPF.

What I'm trying to do should, I think, be basic, but it doesn't seem to be
covered in Help or the several WPF books I have.

I've created a basic form and eight subsidiary forms. The basic form
contains eight buttons. I want a user to be able to click a button on the
basic form to open one of the subsidiary forms.

How do I do that?

In the button click event you would instantiate an object of the form
you want to open:

FormName myForm = new FormName();

and then you would show it, usually with the ShowDialog method:

myForm.ShowDialog();

Yes, this is very basic stuff.
 
Back
Top