private void Canvas_MouseDown(object sender, MouseEventArgs e) { drawing = true; var a = random.Next (32, 256); var r = random.Next (0, 256); var g = random.Next (0, 256); var b = random.Next (0, 256); var polyline = new Polyline (Color.FromArgb (a, r, g, b), random.Next (1, 10)); polyline.Add (e.Location); polylines [currentPolyline++] = polyline; }