I have a PictureBox
which resides in Class A
(essentially a single tabpage), which has all of its methods OnPaint()
defined inside there.
I want to declare another PictureBox2
which resides in Class B
(another tabpage). So technically all of its OnPaint()
code will be the same, just that the name changes.
My question is that which would be a better way: To copy the entire OnPaint()
in Class A
into Class B
, modifying the PaintBox
that it refers to; or is there a better way to avoid the double work? (Like calling the Class A
OnPaint()
from Class B
with a parameter?)