正下方吗,这么写就行了
private void button1_Click(object sender, EventArgs e)
{
Form2 f2 = new Form2();
Point startPoint = PointToScreen(button1.Location);
startPoint.Y += button1.Height;
f2.StartPosition = FormStartPosition.Manual;
f2.Location = startPoint;
f2.Show();
}
'在子窗体里添加代码:
Private Sub Form_Load()
'在MDI窗体的正中
Me.Top = (MDIForm1.ScaleHeight - Me.Height) / 2
Me.Left = (MDIForm1.ScaleWidth - Me.Width) / 2
'左上角
'Me.Top = 0
'Me.Left = 0
按钮的正下方的坐标为:
Point lctn = new Point();
lctn.X=btn.left;
lctn.Y=btn.Top+btn.Height;