Switching Between Forms

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
 
J

joecool1969

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.
 
G

Gordon Padwick

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

C# and WPF 2
TypeConverters 2
WPF modaless dialog on Winforms. 4
50 % opaque normal window, impossible in WPF? 6
C# Vocabulary 7
New to WFP 23
WPF Button Size and Text Wrapping 2
DoEvents for wpf? 2

Top