简体   繁体   English

C#-WPF模态窗口

[英]C# - WPF modal window

Is it possible to switch or activate other windows when modal window is open? 模态窗口打开时是否可以切换或激活其他窗口?

Window1 window = new Window1();
window.ShowDialog();

If I understood you correctly you can do something like the following: 如果我对您的理解正确,则可以执行以下操作:

Window1 window = new Window1();    
window.Activate(); 

This will activate window and bring it to the foreground. 这将激活窗口并将其带到前台。

I don't think it's possible to set the control back to parent form from a modal window(That's the point of using Modal Window). 我认为不可能从模态窗口中将控件设置回父窗体(这就是使用“模态窗口”的目的)。 You can use non modal window. 您可以使用非模态窗口。

window.Show();

If you use window.Activate(); 如果使用window.Activate(); it will not show the form. 它不会显示表格。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM