public Form1() { InitializeComponent(); graphicsFree = panel1.CreateGraphics(); graphicsFree = FreePanel.CreateGraphics(); firstPen.SetLineCap(System.Drawing.Drawing2D.LineCap.Round, System.Drawing.Drawing2D.LineCap.Round, System.Drawing.Drawing2D.DashCap.Round); }
private void FreePanel_MouseMove(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Left) { if (comboBox1.Visible == false) { graphicsFree = FreePanel.CreateGraphics(); current = e.Location; graphicsFree.DrawLine(firstPen, old, current); old = current; } else { comboBox1.Visible = true; if (comboBox1.Text == "1") { graphicsFree = FreePanel.CreateGraphics(); current = e.Location; graphicsFree.DrawLine(firstPen, old, current); old = current; } } } }