📄 frmtest.frm
字号:
VERSION 5.00
Begin VB.Form frmtest
Caption = "Form1"
ClientHeight = 1890
ClientLeft = 5745
ClientTop = 5535
ClientWidth = 6270
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 1890
ScaleWidth = 6270
Begin VB.Timer Timer1
Interval = 10
Left = 5880
Top = 1080
End
Begin VB.Label Label1
Caption = $"frmtest.frx":0000
Height = 1215
Left = 360
TabIndex = 0
Top = 240
Width = 5415
End
End
Attribute VB_Name = "frmtest"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'********************************************************
'演示窗体载入时逐渐显示效果 (版权没有,翻版不究)
'作 者:小杰
'说 明:呵呵,昨天晚上的问题解决了,现在在窗体装载和卸载时
' 都可以"淡入淡出"了
'联系我:xiejienet@126.com QQ:344177293
'********************************************************
Option Explicit
Dim showfrm As Boolean
Dim i As Integer
Dim closefrm As Boolean
Private Sub Form_Load()
Call setfrm(Me, 0) '刚装载时全透明
showfrm = True '窗体逐渐显示(False时逐渐隐藏)
End Sub
Private Sub Form_Unload(Cancel As Integer)
If closefrm = True Then Exit Sub
Cancel = 1
showfrm = False '窗体逐渐显示(False时逐渐隐藏)
Timer1.Enabled = True
End Sub
Private Sub Timer1_Timer()
If showfrm Then
i = i + 3
If i >= 255 Then
i = 255
Timer1.Enabled = False
End If
Else
i = i - 2
If i <= 0 Then
i = 0
closefrm = True '告诉frm这是真的要关闭了
Unload Me
Exit Sub '这句很重要,去掉就不行了
Timer1.Enabled = False
End If
End If
setfrm Me, i ' 根据i值设置窗体
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -