在窗体类的最外面定义一个委托:
public delegate void SelectPointHandler(object sender, PointObject point);pointobject为传递的参数
在窗体的事件下:
private void btnOK_Click(object sender, EventArgs e)
{
。。。。。。。
if (SelectedPoint != null)
SelectedPoint(this, point);
}
public event SelectPointHandler SelectedPoint;
弹出窗体的地方:
SelectPoint select = new SelectPoint();
select.SelectedPoint += new SelectPointHandler(SelectedPoint);
select.ShowDialog();
void SelectedPoint(object sender, PointObject point)
{
。。。。。
}