Gradient bitmaps and the paint event
Posted on 2006-06-14
I have a form with the background image set to a gradient image. On the form is docked a splitcontainer with all of the appropriate backcolor properties set to color.transparent
Problem is that if I resize or change the orientation of the split, it appears as if the paint event fires numerous times. It also doesn't repaint the actual gradient region, but rather flashes multiple times in the main graident color.
So my question is, is there a way to foce or control the paint event so that any resizing, repainting, etc, appears seemless.
i've tried double buffering, suspend layout, setting the visible property, etc, to no avail - always flashes.
Note - if the form's back color is just set to a solid backcolor (no backimage) then refreshing/painting is pretty smotth. It's oly whne the background cointains an image that multiple redraws seem to rake place.