我正在用 C# 开发一个应用程序.我在 WPF 下使用 .Net.我想打开一个新的子窗口(如对话框),它应该在主窗口中打开,就在菜单栏的下方.
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?
试试这个.
MyChildWindow cw = new MyChildWindow();
cw.ShowInTaskbar = false;
cw.Owner = Application.Current.MainWindow;
cw.Show();
这篇关于如何在WPF中单击菜单项时在父窗口下打开子窗口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!