我想做一个按钮,在点击他后,过5分钟弹出另一个窗口,怎么做?

解决方案 »

  1.   

    在按钮事件中加sleep(300000)   '300000秒,即5分钟frmShow.show 1
      

  2.   

    form1,timer1另一窗体form2
    Dim itime As Integer
    Private Sub Form_Load()
    Timer1.Enabled = True
    Timer1.Interval = 1000
    End SubPrivate Sub Timer1_Timer()
    itime = itime + 1
    If itime = 300 Then
    Form2.Show
    Form2.ZOrder 0
    End If
    End Sub
      

  3.   

    在模块里添加:
    Public Declare Sub Sleep Lib "kernel32" Alias "Sleep" (ByVal dwMilliseconds As Long)
    在窗体里:Private Sub Command1_Click()
      Sleep(300000)
      Form2.Show
    End Sub
      

  4.   

    用timer控件也可以
    在按钮click事件里加入
    Timer1.InterVal=300,000
    Form1.show 1
      

  5.   

    private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)sleep(300000)   '300000秒,即5分钟
    frmShow.show 1
    不过这样做线程被挂起,没有响应或者用Timer控件
    sub command1_click()
       timer1.interval=1000
       timer1.enable=true
    end subsub timer1_click()    static i as integer
        i=i+1
        if i=30 then
              frmshow.show 1
              i=0
               timer1.enable=false
        end if
    end sub
      

  6.   

    timer1.interval=5000
    private sub command1_click()
     timer1.enabled=true
    end sub
    private sub timer1_timer()
     form1.show
    end sub
      

  7.   

    timer1.interval=300000      纠正