Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 926
Mukthi Avatar asked Sep 10 '11 17:09

Mukthi


1 Answers

Try this.

MyChildWindow cw = new MyChildWindow();
cw.ShowInTaskbar = false;
cw.Owner = Application.Current.MainWindow;
cw.Show();
like image 109
Henry Tshobo Avatar answered Oct 16 '22 20:10

Henry Tshobo