Dave Kreskowiak is right, please see his comment to the question. Nothing is cancelled or disabled.
Not only handling
Paint
event of the
PictureBox
makes no sense, using
PictureBox
for rendering graphics makes no sense at all (even though it is possible). This is just a control designed to show some static image in a simplified way, a wrapper of an image created just for convenience. It's functionality is totally redundant. You can render graphics on your own custom control or many other controls, such as
Panel
.
Please see my past answers which explain pretty much everything:
Append a picture within picturebox[
^],
draw a rectangle in C#[
^],
How do I clear a panel from old drawing[
^].
For explanation of graphics rendering in
System.Windows.Forms
using
System.Drawing
, please see my past answers:
What kind of playful method is Paint? (DataGridViewImageCell.Paint(...))[
^],
capture the drawing on a panel[
^],
Drawing Lines between mdi child forms[
^],
How to speed up my vb.net application?[
^],
Zoom image in C# .net mouse wheel[
^].
—SA