c#,XAML弹出窗口没有显示在屏幕截图中
本文关键字:显示 屏幕截图 窗口 XAML | 更新日期: 2023-09-27 18:16:37
我在一个自定义GUI应用程序中有许多弹出窗口。这些弹出窗口是窗口对象,而不是弹出对象。当使用键盘上的"打印屏幕"按钮时,弹出窗口不会显示在屏幕截图中。相反,下面被禁用的主窗口是屏幕截图中显示的全部内容。弹出窗口从不闪烁或消失,它只是没有显示在屏幕截图。
WindowInstance.IsEnabled = true;
WindowInstance.Refresh();
DisplayPopUpWindow(WindowInstance);
DisplayPopupWindow中的代码:
private void DisplayPopUpWindow(Window theWindow)
{
if (theWindow != null)
{
if (theWindow is MessagePopup)
{
// Only show one popup at a time (queue is handled elsewhere)
RemovePopUpsCommand.Execute(true, null);
}
ActiveWindow.IsEnabled = false; // main screen disabled
foreach (KeyValuePair<Window, int> aPopup in popUpWindows)
{
if ((aPopup.Key.IsVisible) && (aPopup.Key.Opacity == 1) && (aPopup.Key != theWindow))
{
// if window is a lower priority then disable it
if (aPopup.Value > displayPriority)
aPopup.Key.IsEnabled = false;
}
}
theWindow.Show();
theWindow.Opacity = 1;
}
}
是否有一些属性在XAML,影响窗口是否可见的截图?这是一个大问题,因为这也会影响我们使用的一些远程软件,因为弹出框不会显示在共享屏幕上。也会影响我们的组合框实现。
"弹出窗口"实际上是他们自己的独立窗口。有些实例在应用程序启动期间创建一次,并在需要时简单地显示/隐藏,但是,大多数实例是根据需要创建的,以便显示。此问题影响两种类型。
使用的远程软件是axeda access remote
如果我记得正确的话,我也有同样的问题,我认为这与将弹出窗口的父窗口设置为修复它的主窗口有关,我必须在家里查看我的代码来确认。
确保这个设置正确。
编辑:创建Window对象时尝试使用以下代码:
MainWindowVariable.Owner = Window.GetWindow(this)
你可以在这里阅读更多内容:
http://msdn.microsoft.com/en-us/library/system.windows.window.owner (v = vs.110) . aspx