就在 private void button1_Click(object sender, EventArgs e)
{
Form f = new Form2();
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)
{
Form f = new Form2();
f.Location = new Point(this.Location.X + this.Width, this.Location.Y);//form2随着form1移动
}
不知道为什么不正确,只能实现form2挨着form1 不能随其form1移动而移动
请哪位大神帮忙改下,让我能实现这个功能!!!
{
Form f = new Form2();
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)
{
Form f = new Form2();
f.Location = new Point(this.Location.X + this.Width, this.Location.Y);//form2随着form1移动
}
不知道为什么不正确,只能实现form2挨着form1 不能随其form1移动而移动
请哪位大神帮忙改下,让我能实现这个功能!!!
解决方案 »
- 高人帮帮忙啊,还是低版本.net调用高版本.net程序
- 新建一个实体student,list<student> a添加数据后,清空数据用a.clear()与a=new list<student>哪一种,有啥区别
- 向大家问一个关于textBox控件设置passwordcha后赋值的问题
- 一个关于 Dictionary<int, List<int>>的问题
- 动态产生控件时如何能够换行
- 为什么
- 使用C#编写SQL数据库自动更新程序的难题!
- 请教各位,记录日志时怎么处理换行问题?
- c#可以象jscript那样灵活的控制浏览器么?
- FormClosing事件
- 我前段时间做的一个小型网站,和SILVERLIGHT比较,大家看看怎么样??
- DataGridview数据绑定问题
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移动
}
可以试试这样
Form f = new Form2();你又new了一个form2,这个form2已经不是你刚才的form2了,你大爷仍然是你大爷