问题是它们在不同的地方开放。
注意:这种情况发生在某些笔记本电脑(PC)上,而不是全部。
我的笔记本电脑= ZenBook型号:UX303L(Windows 8.1)
我的代码:
public MainWindow()
{
InitializeComponent();
CreatePopup(true);
CreatePopup(false);
}
private void CreatePopup(bool haveChild)
{
Popup popup = new Popup();
popup.Width = 200;
popup.Height = 200;
popup.HorizontalOffset = 500;
popup.VerticalOffset = 50;
if (haveChild)
{
var tb = new TextBlock() { Text = "TextBlock1", Background =
Brushes.Yellow, Width = 200, Height = 200 };
tb.FlowDirection = FlowDirection.LeftToRight;
popup.Child = tb;
}
popup.StaysOpen = true;
popup.IsOpen = true;
}