How to open a child windows under parent window on menu item click in WPF?

Up vote 0 down vote favorite share g+ share fb share tw.

I am developing an application in C#. I'm using . Net under WPF.

I want to open a new child window (like a dialog) and it should open within the main window, just below the menu bar. However, the newly opened windows is simply showing an OS task bar. How can I open the various new windows(like a dialog box) under the main window?

C# wpf wpf-controls modal-dialog wpf-usercontrols link|improve this question edited Sep 11 '11 at 0:03Adel8781418 asked Sep 10 '11 at 17:23Mukthi13310 63% accept rate.

Try this. MyChildWindow cw = new MyChildWindow(); cw. ShowInTaskbar = false; cw.

Owner = Application.Current. MainWindow; cw.Show().

If you have multiple windows and the Application.Current. MainWindow is not the desired Window, You could use VisualTreeHelper. GetParent to traverse the tree until you reach the current window.

– dowhilefor Sep 10 '11 at 19:09 For a dialog, you should use ShowDialog as opposed to Show. – crazyarabian Sep 11 '11 at 0:40.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions