Reputation: 1003
I am making a winforms designer control. The move/resize boxes are essentially pictureboxes
added as child controls to a parent picturebox
control (call it 'Canvas'). All the actual drawing is done in the 'Canvas' pictureboxe's OnPaint
Event, using the child pictureboxes for the locations and sizes. This is done via a loop, so all images/text gets drawn in one OnPaint event.
The problem is that each child control invalidates the parent 'Canvas' control, thus the same images/text get drawn repeatedly rather than just once. So, 5 child pictureboxes, Canvas gets redrawn 5 times....
The pictureboxes have to be child controls. Is there any way to stop these child controls automatically invalidating their parent control?
Upvotes: 0
Views: 99