It looks like you are trying to abuse
PictureBox
. There are no situations where you need to draw on it, even though you can. If you need to draw in a bitmap, you can do it directly. If you need to draw on some UI control,
PictureBox
won't help you at all; it would only create and additional level of indirection, giving nothing in return. It would only eat up your development time and some extra resources, including CPU time.
What to do instead? This is easy. Please see my past answers:
How do I clear a panel from old drawing[
^],
draw a rectangle in C#[
^],
Append a picture within picturebox[
^].
Please also see these related answers:
Drawing Lines between mdi child forms[
^],
What kind of playful method is Paint? (DataGridViewImageCell.Paint(...))[
^],
capture the drawing on a panel[
^].
—SA