首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

Form窗体背景透明,该怎么解决

2012-03-21 
Form窗体背景透明一个Form窗体,属性FormBorderStyle:None,我用设计窗体的外观,Panel都透明,用.png的图片填

Form窗体背景透明
一个Form窗体,属性FormBorderStyle:None,我用设计窗体的外观,Panel都透明,用.png的图片填充panel背景,我想实现窗体的四个角有椭圆的效果,但是运行后,四个角有颜色:Control,我PS的那四个角是透明,是椭圆的。

  我想要这个效果该怎么做?

[解决办法]

C# code
    public partial class Form2 : Form    {        public Form2()        {            InitializeComponent();            using (GraphicsPath path = new GraphicsPath())            {                int r = 32;//圆角半径                path.AddArc(0, 0, r, r, 180, 90);                path.AddArc(this.Width - r - 1, 0, r, r, 270, 90);                path.AddArc(this.Width - r - 1, this.Height - r - 1, r, r, 0, 90);                path.AddArc(0, this.Height - r - 1, r, r, 90, 90);                this.Region = new Region(path);            }        }    }
[解决办法]
但是如果有渐变淡出效果ls的都不行吧
看这个吧
A lovely goldfish desktop pet (using alpha-PNG and GDI+)

热点排行