日期:2014-05-17 浏览次数:20838 次
private void panel1_MouseClick(object sender, MouseEventArgs e)
{
Button bt1 = new Button();
bt1.Parent = this.panel1;
bt1.Location = panel1.PointToClient(Control.MousePosition);
Controls.Add(bt1);
}
Button bt1 = new Button();
bt1.Location = new Point(e.X, e.Y);
panel1.Controls.Add(bt1);