Option Explicit Dim lngP As Long Private Declare Function GetTickCount Lib "kernel32" () As Long Private Sub Form_Load() Timer1.Enabled = True Timer1.Interval = 1000 lngP = GetTickCount End Sub Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) If Not Timer1.Enabled Then Form2.Show Form2.WindowState = 2 '窗体最大化 End If End SubPrivate Sub Timer1_Timer() '显示30秒关闭窗体 If GetTickCount - lngP > 30000 Then Timer1.Enabled = False Unload Me End If End Sub
1、创建一个工程,包含Form1和Form2两个窗体,其中Form1为小页面,Form2为主页面,设置Form1为工程启动项2、工程启动,首先加载Form1,在form1中添加一个定时器,用于卸载Form1(显示一段时间后卸载)并加载Form2,也就是主页面
Dim lngP As Long
Private Declare Function GetTickCount Lib "kernel32" () As Long
Private Sub Form_Load()
Timer1.Enabled = True
Timer1.Interval = 1000
lngP = GetTickCount
End Sub
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
If Not Timer1.Enabled Then
Form2.Show
Form2.WindowState = 2 '窗体最大化
End If
End SubPrivate Sub Timer1_Timer()
'显示30秒关闭窗体
If GetTickCount - lngP > 30000 Then
Timer1.Enabled = False
Unload Me
End If
End Sub
展示屏窗体.show
doevents
load 主窗体
doevents
unload 展示屏窗体
主窗体.show
end sub展示屏窗体里一行代码都不用写.
上面放个好看点的图片就行了.
然后触发:unload form