Hi,
This is a simple example of an application doing roughly what you want (note that this is just to get you started, there are better ways of drawing in C#);
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;
namespace WindowsFormsApplication2
{
public partial class Form1 : Form
{
IList<Point> points = new List<Point>();
public Form1()
{
this.MouseClick += new MouseEventHandler(Form1_MouseClick);
}
void Form1_MouseClick(object sender, MouseEventArgs e)
{
points.Add(e.Location);
this.Invalidate();
}
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
Point previousPoint = Point.Empty;
foreach (Point point in points)
{
if (previousPoint != Point.Empty)
{
e.Graphics.DrawLine(Pens.Black, previousPoint, point);
}
previousPoint = point;
}
}
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
}
}