WinForm 控件实现半透明效果,并可层叠显示
作者:互联网
原文链接:http://www.cnblogs.com/linji/archive/2012/09/20/2694649.html
public class CYBaseControl : Control
{
public CYBaseControl()
{
this.SetStyle(ControlStyles.SupportsTransparentBackColor |
ControlStyles.Opaque, true);
this.BackColor = Color.Transparent;
}
protected override CreateParams CreateParams
{
get
{
CreateParams cp = base.CreateParams;
cp.ExStyle = 0x20;
return cp;
}
}
}
已知问题:该类控件无法启用双缓冲,所以不适合做动态效果,闪烁会很严重;层叠控件时绘制顺序会乱掉,可能是我绘制绘制控件的时候没有做判断顺序的原因
转载于:https://www.cnblogs.com/linji/archive/2012/09/20/2694649.html
标签:控件,www,层叠,2694649,CreateParams,cp,绘制,WinForm 来源: https://blog.csdn.net/weixin_30695195/article/details/97242476