或者: 两个窗体,form1和form2,从form1启动程序,form1上有一timer控件: Option Explicit Dim i As LongPrivate Sub Form_Load() Timer1.Interval = 1000 Timer1.Enabled = True End SubPrivate Sub Timer1_Timer() i = i + 1 If i >= 10 Then Form2.Show Timer1.Enabled = False End IfEnd Sub
给你一个我的例子:标准模块中: Sub delay(ByVal n As Single) Dim tm1 As Single, tm2 As Single tm1 = Timer Do tm2 = Timer If tm2 < tm1 Then tm2 = tm2 + 86400 If tm2 - tm1 > n Then Exit Do DoEvents Loop End Subsub main()中调用: delay 2 Unload Form1 一切OK!试试吧~
程序的启动logo 需用sub main()过程作为启动对象,并用show方法显示该窗体: private sub main() '打开快速显示窗体 frmsplash.show '在此处添加启动过程. '...... '显示主窗体并卸载快显示窗体 frmmain.show unload frmsplash end sub
呵呵!我发现楼主要的是Form1消失吧!刚刚那个大侠已经写好了!但是Form1不会消失!所以: Option Explicit Dim i As LongPrivate Sub Form_Load() Timer1.Interval = 1000 Timer1.Enabled = True End SubPrivate Sub Timer1_Timer() i = i + 1 If i >= 10 Then Form2.Show Form1.Hide Timer1.Enabled = False End IfEnd Sub 呵呵!我是新手!请各位大侠指教呀!
两个窗体,form1和form2,从form1启动程序,form1上有一timer控件:
Option Explicit
Dim i As LongPrivate Sub Form_Load()
Timer1.Interval = 1000
Timer1.Enabled = True
End SubPrivate Sub Timer1_Timer()
i = i + 1
If i >= 10 Then
Form2.Show
Timer1.Enabled = False
End IfEnd Sub
Sub delay(ByVal n As Single)
Dim tm1 As Single, tm2 As Single
tm1 = Timer
Do
tm2 = Timer
If tm2 < tm1 Then tm2 = tm2 + 86400
If tm2 - tm1 > n Then Exit Do
DoEvents
Loop
End Subsub main()中调用:
delay 2
Unload Form1
一切OK!试试吧~
也可以在FORM1显示的同时就运行FORM2,但FORM2是在后台运行而不显示,
10秒钟后再把FORM1卸掉,把FORM2显示出来。
需用sub main()过程作为启动对象,并用show方法显示该窗体:
private sub main()
'打开快速显示窗体
frmsplash.show
'在此处添加启动过程.
'......
'显示主窗体并卸载快显示窗体
frmmain.show
unload frmsplash
end sub
Option Explicit
Dim i As LongPrivate Sub Form_Load()
Timer1.Interval = 1000
Timer1.Enabled = True
End SubPrivate Sub Timer1_Timer()
i = i + 1
If i >= 10 Then
Form2.Show
Form1.Hide
Timer1.Enabled = False
End IfEnd Sub
呵呵!我是新手!请各位大侠指教呀!