new出这个窗体的时候,获取主窗体的坐标,this.Location.X,this.Location.Y;
当新窗体show之后,你说可以移动,没问题的,有一个locationChanged事件,这时把新窗体的坐标获取出来就可以了,再和之前主窗体的坐标可以比较了。
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
this.LocationChanged += new System.EventHandler(this.Form1_LocationChanged);
}
private void Form1_LocationChanged(object sender, EventArgs e)
{
this.Text = string.Format("Left={0},Top={1}", this.Left, this.Top);
}
}