Well you call Picture1.Line but then you call Form1.Picture1.hDC to get it's hDC... my suggestion to you is put Form1.Picture1.Line instead of just Picture1.Line.