打印本文 打印本文 关闭窗口 关闭窗口
VB.NET窗口渐淡关闭
作者:武汉SEO闵涛  文章来源:敏韬网  点击数990  更新时间:2009/4/23 19:01:17  文章录入:mintao  责任编辑:mintao

Private Sub Form1_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
If MsgBox("請注意看關閉的視窗", MsgBoxStyle.Question + MsgBoxStyle.OKCancel, "關閉") = MsgBoxResult.OK Then
Dim d As Double
For d = 1 To 0 + 0.2 Step -0.2
System.Threading.Thread.Sleep(50)
Application.DoEvents()
Me.Opacity = d
Me.Refresh()
Next d
Else
e.Cancel = True
End If
        ''''1.設視窗為Form1
        ''''2.將變數命名為d
        ''''3.依物件名稱適當更改程式碼
End Sub

--蓝色小铺(http://www.blueshop.com.tw/SkillBoard/show.asp?repno=1232&page=1&PgmType=ASP.NET)

打印本文 打印本文 关闭窗口 关闭窗口