我有一个System.Window.Forms.Form处理每个按钮点击的地方.当我收到第一个事件时,我创建了一个新的WPF System.Windows.Window对象.
class WPF_Window : Window
{
}
public partial class Form1 : Form
{
WPF_Window wnd = null;
public Form1()
{
InitializeComponent();
}
private void Form1_MouseClick(object sender, MouseEventArgs e)
{
if (wnd == null)
{
wnd = new WPF_Window();
}
}
}
Run Code Online (Sandbox Code Playgroud)
在我的计算机上,此代码按预期工作,但如果我在另一台计算机(Windows 10)上运行它,当我单击Windows窗体窗口时更改其大小(减小其尺寸).
这怎么可能?我该如何避免这种行为?