Winform,Panel设置BackColor = Color.Transparent后控件闪烁的厉害
Winform,Panel设置BackColor = Color.Transparent后控件闪烁的厉害,有哪位仁兄解决过这样的问题,网上查了下是微软处理Panel的时候没有加上双缓冲的缘故,我自己重绘了下Panel:
public partial class PanelDoubleBuffer : Panel
{
public PanelDoubleBuffer()
{
InitializeComponent();
//屏闭系统绘制
this.SetStyle(
ControlStyles.AllPaintingInWmPaint |
ControlStyles.OptimizedDoubleBuffer |
ControlStyles.UserPaint|
ControlStyles.SupportsTransparentBackColor, true);
this.UpdateStyles();
this.DoubleBuffered = true;
}
}
一样不能解决这样的问题。。在窗体上,一旦设置Panel的BackColor = Color.Transparent,加载Panel上的控件就闪的厉害,求解……