Drawing on a textBox in C# with mouse
<p>I have an assignment to write  a program in C# that uses a panel for scroll bars (which I have accomplished) and adding a picture box on top of that to allow drawing with a mouse. The program is also supposed to allow the user to choose different options from the menustrip. These include saving, saving as, resizing the image, choosing brush: size, shape, color. and the user has to be able to erase with the right mouse button. I am having a hard time just getting the drawing part to work. Here is what I have so far:</p>

<pre><code>using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace PaintProgram_odelld
{
    public partial class Form1 : Form
    {
        bool canPaint = false;

        public Form1()
        {
            InitializeComponent();
        }

        private void pictureBox1_MouseMove(object sender, MouseEventArgs e)
        {
            if (canPaint)
            {
                Bitmap Image = new Bitmap(pictureBox1.Image);

                using (Graphics graphics = CreateGraphics())
                {
                    graphics.FillEllipse(new SolidBrush(Color.BlueViolet), e.X, e.Y, 4, 4);
                    pictureBox1.Image = Image;
                }
            }
        }

        private void pictureBox1_MouseUp(object sender, MouseEventArgs e)
        {
            //indeicate release of the mouse button
            canPaint = false;
        }

        private void pictureBox1_MouseDown(object sender, MouseEventArgs e)
        {
            //the user is dragging the mouse
            canPaint = true;
        }
    }
}
</code></pre>

<p>any suggestions?</p>
