//添加点 private void btnAddPoint_Click(object sender, EventArgs e) { AddPointForm addpoinform = new AddPointForm(); addpoinform.ShowDialog(); if (addpoinform.ClickAdd) { PointF dot = new Point(); dot.X = (float)addpoinform.m_dbX; dot.Y = (float)addpoinform.m_dbY; m_arrayDot.Add(dot); } ViewListPoint();//更新显示列表 }
//修改点对象 private void btnModifyPoint_Click(object sender, EventArgs e) { int selectindex = lsbPoint.SelectedIndex; if (selectindex < 0) { MessageBox.Show("请先选择要修改的点对象", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } AddPointForm addpointform = new AddPointForm(); addpointform.m_dbX = m_arrayDot[selectindex].X; addpointform.m_dbY = m_arrayDot[selectindex].Y; addpointform.ShowDialog(); if (addpointform.ClickAdd) { m_arrayDot.RemoveAt(selectindex); PointF dot = new PointF(); dot.X = (float)addpointform.m_dbX; dot.Y = (float)addpointform.m_dbY; m_arrayDot.Insert(selectindex, dot); } ViewListPoint();//更新显示列表 }