弹出form的位置 为什么会不一样?
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace WindowsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
Form2 f2 = new Form2();
f2.Location = this.Location;
f2.Show();
}
}
}
------解决方案--------------------f2.StartPosition = FormStartPosition.Manual;
Point nl = new Point(3, 4); //坐标可以自己定
f2.Location = nl;