If you use panel paint event you do not need a picture box; you need to draw on the canvas of the panel. In this case, you should never use
CreateGraphics
. When you create a handler to the event, graphics is already created for you and passed in second parameter (event argument) to your handler. Walt Fair tried to explain this to you, but it looks you need more detail. Something like that:
MyPanel.Paint += (sender, args) => {
args.Graphics.DrawLine(...
args.Graphics.DrawImage(...
};
Fair enough? ;)