Пример #1
0
        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);
        }
Пример #2
0
 private void Button6_Click(object sender, EventArgs e)
 {
     if (comboBox1.Visible == false)
     {
         FreePanel.BackColor = Color.White;
         FreePanel.Invalidate();
     }
     else if (comboBox1.Text == "1")
     {
         FreePanel.BackColor = Color.White;
         FreePanel.Invalidate();
     }
     else if (comboBox1.Text == "2")
     {
         panel1.BackColor = Color.White;
         panel1.Invalidate();
     }
 }
Пример #3
0
 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;
             }
         }
     }
 }