How to draw a single line using MouseMove Event
I'm trying to draw a single line using OnMouseMove() event. My Problem is that everytime I move the mouse It leaves a trail. I tried to use the refresh method, but when I stop moving the mouse the line is gone. I don't want the line to be drawn OnPaint(); , Just want to draw it OnMouseMove() . EDIT: I'm using a transparent panel(cp.ExStyle |= 0x20;), so I cant use the graphics.Clear() and BackColor() Here's a Sample Image without the Refresh() : Here's my code: private void panel1_MouseMove(object sender, MouseEventArgs e) { Graphics g = panel1.CreateGraphics(); g.SmoothingMode = System