List<Point> points = new List<Point>();
private void pictureBox1_MouseDown(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
points.Add(e.Location);
pictureBox1.Invalidate();
}
}
private void pictureBox1_Paint(object sender, PaintEventArgs e)
{
if (points.Count > 1)
e.Graphics.DrawLines(Pens.Magenta, points.ToArray());
}
I have been drawing lines, curves, ...I have the button: btnDrawLine, btnDrawCurve
Each button press will call a function to draw.When you press the button, an item be added to the listbox.
For example:click btnDrawLine-> "combobox" add Line.
The user can move the line or curve by selecting the name in the listbox.
How do I do this?
thank.I will put an object (line, Curve) into a PictureBox.
How to a PictureBox always display when other PictureBox override it?