3

So Here is the thing i can open new windows in WPF but what i am trying to do is after opening a new window (lets call it window2) i want to be able to open another new window(window3)from window2 but when i put in the code it wont let me.

On my mainWindow:

var newWindow = new window2(); newWindow.ShowDialog(); 

but in window2 if i use the same code to open a new window:

var newWindow = new window3(); newWindow.ShowDialog(); 

it wont allow me to use Show() or ShowDialog().

So what i was wondering was can u open a 3rd window like this or is there something i am missing or is there something different i can do?

4
  • Show us the declarations for window2 and window3. Commented Feb 23, 2014 at 0:31
  • “it wont allow me to use Show() or ShowDialog().” – How does it tell you that? Commented Feb 23, 2014 at 0:33
  • you will have to bear with me i am really new to C# and programming so Commented Feb 23, 2014 at 0:35
  • the intellisence wont let me pick it Commented Feb 23, 2014 at 0:35

1 Answer 1

1

ShowDialog is modal (all input constrained to that window). You have to close the modal window before opening any other windows, thats the point of it!

What are you actually trying to achieve? In general modal windows are not a good user experience

Sign up to request clarification or add additional context in comments.

1 Comment

Thank u was just reading up there on modeless windows and it all makes sense now.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.