C#透明窗體實(shí)現(xiàn)方法
更新時(shí)間:2015年06月11日 12:27:29 作者:zhuzhao
這篇文章主要介紹了C#透明窗體實(shí)現(xiàn)方法,涉及C#窗體操作的相關(guān)技巧,需要的朋友可以參考下
本文實(shí)例講述了C#透明窗體實(shí)現(xiàn)方法。分享給大家供大家參考。具體實(shí)現(xiàn)方法如下:
namespace WindowsApplication1 { public partial class Form2 : Form { public Form2() { InitializeComponent(); this.Opacity = 1; this.Text = "opacity=1"; this.TopMost = true; } private void Form2_Activated(object sender, EventArgs e) { this.timer1.Enabled = true; } private void Form2_Deactivate(object sender, EventArgs e) { this.timer1.Enabled = false; this.Opacity = 1; this.Text = "opacity=" + this.Opacity.ToString(); } private void Form2_Load(object sender, EventArgs e) { } private void timer1_Tick(object sender, EventArgs e) { if (this.Opacity > 0) { this.Opacity -= 0.1; this.Text = "opacity=" + this.Opacity.ToString(); } else if (this.Opacity == 0) { this.Close(); } else this.timer1.Enabled = false; } } }
希望本文所述對(duì)大家的C#程序設(shè)計(jì)有所幫助。
相關(guān)文章
C#畫(huà)圖之餅圖折線圖的實(shí)現(xiàn)方法
這篇文章主要介紹了C#畫(huà)圖之餅圖折線圖的實(shí)現(xiàn)方法,以實(shí)例形式講述了C#畫(huà)圖的完整實(shí)現(xiàn)過(guò)程,是非常實(shí)用的技巧,有不錯(cuò)的借鑒價(jià)值,需要的朋友可以參考下2014-09-09C#中Abstract 、Virtual和Override的使用及區(qū)別
C#中virtual,abstract,override用于方法重載,子類覆蓋了父類的相同方法,父類中的實(shí)現(xiàn)不可能再被外面調(diào)用。本文給大家重點(diǎn)介紹C#中Abstract 、Virtual和Override的使用及區(qū)別,需要的朋友參考下吧2021-06-06WPF實(shí)現(xiàn)3D翻牌式倒計(jì)時(shí)特效
這篇文章主要為大家詳細(xì)介紹了WPF實(shí)現(xiàn)3D翻牌式倒計(jì)時(shí)特效,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2020-09-09實(shí)現(xiàn)ASP.NET無(wú)刷新下載并提示下載完成的開(kāi)發(fā)思路
這篇文章主要介紹了實(shí)現(xiàn)ASP.NET無(wú)刷新下載并提示下載完成的開(kāi)發(fā)思路的相關(guān)資料,需要的朋友可以參考下2015-10-10C#結(jié)合JavaScript實(shí)現(xiàn)多文件上傳功能
在許多應(yīng)用場(chǎng)景里,多文件上傳是一項(xiàng)比較實(shí)用的功能,本文主要為大家詳細(xì)介紹了C#如何結(jié)合JavaScript實(shí)現(xiàn)多文件上傳功能,感興趣的小伙伴可以了解下2023-12-12