private void button1_Click(object sender, EventArgs e) { Frm f = new Frm(); f.StartPosition = FormStartPosition.Manual;//窗体的位置由 System.Windows.Forms.Control.Location 属性确定 f.Location = new Point(200,200); //开启时的左上角坐标 f.ShowDialog(); } private void button2_Click(object sender, EventArgs e) { this.Location = new Point(300, 410); //移动当前窗口到指定位置 }
C# 将窗口移动到指定位置
时间: 2024-10-17 08:45:12