无意间看到我们有些软件在关闭窗口时会出现渐变的玻璃效果,我思索了下,在C#下实现是怎样的呢? 仔细一想,其实不难,用winform的Opacity属性就可以了。 实现代码如下: private void buttonExClose_Click(object sender, EventArgs e) { for (int i = 0; i < 10; i++) { this.Opacity -= 0.1; for (int j = 0; j < 10000000; j++) { } } Application.Exit(); this.Dispose(); }