怎样在 unload 中加代码

来源:百度知道 编辑:UC知道 时间:2024/07/01 04:50:44

Private Sub Form_Unload(Cancel As Integer)
MsgBox "我退出了!"
End Sub

先要定义一个函数。如我们事先定义了一个ADMIN的函数

Private Sub Form_Unload(Cancel As Integer)
ADMIN
End Sub
这样就可以了这里我给你一个窗体关闭的时候的特效代码。你试一试

Private Sub Form_Unload(Cancel As Integer) '程序关闭特效
Dim GotoVal As Long, Gotoin As Long, Gointo As Long

GotoVal = Me.Height / 2
For Gotoin = 1 To GotoVal
DoEvents
Me.Height = Me.Height - 10
If Me.Height <= 5 Then GoTo horiz
Next Gotoin
horiz:
Me.Height = 30
GotoVal = Me.Height / 2
For Gointo = 1 To GotoVal
DoEvents
Me.Width = Me.Width - 30
If Me.Width <= 11 Then End
Next Gointo
End
End Sub

Private Sub Form_Unload(Cancel As Integer)
'你的代码
End Sub

窗体退出直接有啊
Private Sub Form_Unload(Cancel As Integer)
'你的代码
End Sub