ity = tps / 100
If Me.Opacity <= 0 Then
Timer1.Enabled = False
bol = False
End If
End If
End Sub
进入Form1_Load事件
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Timer1.Enabled = True
End Sub
进入Form1_Closing事件
Private Sub Form1_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
Timer1.Enabled = True
If MsgBox("你确实要关闭窗体吗?", MsgBoxStyle.OkCancel) = MsgBoxResult.Ok Then
e.Cancel = False
Else
Timer1.Enabled = False
Me.Opacity = 1
tps = 100
bol = True
e.Cancel = True
End If
End Sub
创建完成后我们来运行程序测试一下,测试成功,程序窗体是不是变得透明了,通过调节滚动条我们甚至可以使得窗体消失达到完全隐形的目的。这是不是很神奇呢?