请问怎样使一个窗体停留10秒钟,然后再自动消失。我知道要使用timer控件,但具体怎么写不清楚。
解决方案 »
- vb 6.0 + sql combo 与 text 问题
- 在数组命名后,如何用一个字符串作为数组名来操作数组?
- 高分,请教如何清除IE网址的历史访问记录
- 写了个程序用到了excel的引用,到别人的机器就运行出错,怎么办
- 听说VB只能编些“小”软件,对吗?
- 为什么会出错?
- SendMessage()向CListCtrl对象的某个item发送鼠标单击消息 (选取其中某一 item )
- 哪有光于VB开发数据库程序看,我给出我仅有的一点点分
- 怎样进行数据库的求和操作。
- 如 何 在 文 本 文 件 中 查 找 指 定 字 符 并 将 其 替 换 成 别 的 字 符 ?
- 我自己做了一个控件,在其中定义了一个方法,怎么老是出现错误,大家帮忙看看 谢谢了!!
- ◆求助,如何判断用户有没有按过按钮?◆
Private Sub Timer1_Timer()
MDIForm1.Show
Unload Me
End Sub
在form.load里这样写
Timer1.Interval = 1000
Dim ltime As Date
ltime = Timer()
While Timer() - ltime <= N * 0.05
DoEvents
Wend
End SubPrivate Sub Form_Load()
Me.Show
Call UnloadMe
End SubSub UnloadMe()
Call Wait(200)
Unload Me
Set Form1 = Nothing
End Sub
Timer1.Interval = 1000
Timer1.Enabled = True
End SubPrivate Sub Timer1_Timer()
Unload Me
End Sub
Timer1.Interval = 10000
Timer1.Enabled = True
End SubPrivate Sub Timer1_Timer()
Unload Me
End Sub
Timer1.Interval = 1000
Timer1.Enabled = True
End SubPrivate Sub Timer1_Timer()
Unload Me
End Sub
Private Declare Function GetTickCount Lib "kernel32" () As Long'等待过去多长时间,以毫秒计
Public Sub TimeDelay(DT As Long)
Dim TT As Long
TT = GetTickCount()
Do
DoEvents
If GetTickCount - TT < 0 Then TT = GetTickCount
If gblnCancel = True Then Exit Do '用户单击了取消
Loop Until GetTickCount - TT >= DT
End Sub想要延迟10秒钟,只需
TimeDelay 10000