private void panel1_Paint(object sender, PaintEventArgs e) { Graphics graph = panel1.CreateGraphics(); Pen pen = new Pen(Color.Green, 4); vector.Draw(pen, graph); pen.Dispose(); graph.Dispose(); }