文件名称:C#自定义控件背景色透明的方法
文件大小:15KB
文件格式:DOCX
更新时间:2015-06-28 02:36:05
C# 控件 透明
解决自定义控件不透明的方法。I struggled for ages with the problem of having controls show through a control that was painted on top of them. It seems that ControlStyles.SupportsTransparentBackColor just allowed the control to pick up the container's background colour/image and wouldn't prevent the control from hiding any controls that were underneath it. I eventually found an answer so I thought I would post it here. This code example of a Pointer class, will take an alpha-blended png in the constructor and allow all the controls behind it to show through the transparent or semi-transparent pixels in the png, even when the pointer's location is changed ...