private void SaveElement1_Click(object sender, EventArgs e) { int index = AllElements1.SelectedIndex; Charge point = new Charge(); point.point.x = Convert.ToDouble(FirstPointX1.Text); point.point.y = Convert.ToDouble(FirstPointY1.Text); point.q = Convert.ToDouble(ChargeT1.Text); ((GraphicElStatic)AllGraphics[LeftGraphIndex]).AllElements[index] = point; AllElements1.Items.RemoveAt(index); AllElements1.Items.Insert(index, "x = " + Convert.ToString(point.point.x) + " " + "y = " + Convert.ToString(point.point.y)); }
private void NewPoint1_Click(object sender, EventArgs e) { Charge point = new Charge(); point.point.x = Convert.ToDouble(FirstPointX1.Text); point.point.y = Convert.ToDouble(FirstPointY1.Text); point.q = Convert.ToDouble(ChargeT1.Text); ((GraphicElStatic)AllGraphics[LeftGraphIndex]).AllElements.Add(point); Double x = point.point.x; Double y = point.point.y; AllElements1.Items.Add("x = " + x.ToString() + " " + "y = " + y.ToString()); }