I have a panel with the BackgroundImage set that I'm using as a button. The panel also contains a PictureBox with a png image loaded so that parts of the image are transparent and the panel image shows through. On MouseDown I change the panels BackgroundImage, then on MouseUp I change it back again. The problem is that when the panel image changes, the PictureBox开发者_高级运维 flickers badly when redrawing its transparent areas.
I've tried using the DoubleBuffered property of the form its on; no luck there. I've also tried SuspendLayout just before changing the image, refreshing the PictureBox, then ResumeLayout. Still no luck.
Thanks in advance for any ideas.
It's the bad part of VS in graphic. Try using Form BackgroundImage
property, or overrides OnPaint
event and use Graphics
class to draw the image manually (draw on the Form).
精彩评论