The problem is that you used this.CreateGrap hics() to obtain a graphics object. This gives you a graphics object at the level of the Form, so your line is appearing on the form.

You want your line to appear on the picturebox, so you shouldn't use this.CreateGrap hics(). Instead just use the graphics object that the event args provides you: e.Graphics;

Its always best when in a paint event or OnPaint override to use...