好的,所以我正在使用打开新表单的下一个按钮做一些事情,令人讨厌的是新表单会弹出我不想在桌面上的某个地方。
我正在尝试使用下面的代码让新表单在旧表单的位置生成,不幸的是无论出于何种原因它根本不起作用,它们仍然以与以前相同的方式弹出。是的,我已经注册了这些活动。
表格1:
System.Drawing.Point LocationPoint = new System.Drawing.Point(200,200);
private void Installer_template_LocationChanged(object sender, EventArgs e)
{
// Save the window location to the installer arts
LocationPoint = this.Location;
}
private void NextButton_Click(object sender, EventArgs e)
{
var NextForm = new Form2(LocationPoint);
NextForm.Show();
this.Hide();
}
表格2
public Form2(System.Drawing.Point LocationPoint)
{
InitializeComponent();
this.Location = LocationPoint;
}
代码是这样的