110,499
社区成员
发帖
与我相关
我的任务
分享
Form f = new Form2();
private void button1_Click(object sender, EventArgs e)
{
f.Show();//弹出form2
f.StartPosition = FormStartPosition.Manual;
f.Left = this.Left + this.Width;
f.Top = this.Top;//设置form2位置
}
private void Form1_Move(object sender, EventArgs e)
{
f.Location = new Point(this.Location.X + this.Width, this.Location.Y);//form2随着form1移动
}
可以试试这样