文件名称:C#倒计时关闭对话框
文件大小:132KB
文件格式:RAR
更新时间:2013-12-10 15:59:02
C#
C#倒计时关闭对话框VS2008源代码!Messagebox 自定义倒计时关闭!3秒钟后关闭...2秒钟后关闭...1秒钟后关闭... private void StartKiller() { Timer timer = new Timer(); timer.Interval = 3000; //3秒启动 timer.Tick += new EventHandler(timer1_Tick); timer.Start(); } private void KillMessageBox() { //按照MessageBox的标题,找到MessageBox的窗口 IntPtr ptr = FindWindow(null, "MessageBox"); if (ptr != IntPtr.Zero) { //找到则关闭MessageBox窗口 PostMessage(ptr, WM_CLOSE, IntPtr.Zero, IntPtr.Zero); } }
【文件预览】:
WindowsFormsApplication4
----WindowsFormsApplication4.suo(17KB)
----WindowsFormsApplication4.sln(962B)
----WindowsFormsApplication4()
--------Form1.cs(2KB)
--------bin()
--------obj()
--------Properties()
--------Program.cs(505B)
--------WindowsFormsApplication4.csproj(4KB)
--------Form1.Designer.cs(2KB)
--------Form1.resx(6KB)