Do yourself a favor, don't torture yourself abusing
PictureBox
. This is a very usual mistake.
This control is only good to do something very simple, like showing just one picture (well, maybe changing it, but not often). When you try to do anything more tricky, such as dynamic, interactive, animated, etc., it turns out to be more of an obstacle then a help, eating up your development time, computer performance and extra resources, giving nothing useful in return.
Compared to what? To a custom control derived from
System.Windows.Forms.Control
with graphics rendered in the handler of the event
Paint
, or, better yet, overridden virtual method
OnPaint
.
I explain how in my past answers:
How do I clear a panel from old drawing[
^],
draw a rectangle in C#[
^].
See also other answers:
What kind of playful method is Paint? (DataGridViewImageCell.Paint(...))[
^],
Drawing Lines between mdi child forms[
^],
capture the drawing on a panel[
^].
—SA