Private Sub Form_Load()
 Timer1.Interval = 60000
 Timer1.Enabled = False
 WebBrowser1.Navigate "C:\Program Files\prince\pdll\comweb.html"
End Sub
Private Sub Form_Resize()
  WebBrowser1.Width = form1.ScaleWidth + 270
  WebBrowser1.Height = form1.ScaleHeight + 270
End Sub
Private Sub GOButton_Click()
  WebBrowser1.Navigate (Text1.Text)
End SubPrivate Sub NextButton_Click()
  WebBrowser1.GoBack
End SubPrivate Sub PrvButton_Click()
  WebBrowser1.GoForward
End SubPrivate Sub StopButton_Click()
  WebBrowser1.Stop
End SubPrivate Sub Text1_KeyPress(KeyAscii As Integer)
  If KeyAscii = 13 Then
    WebBrowser1.Navigate (Text1.Text)
  End If
End SubPrivate Sub WebBrowser1_BeforeNavigate(ByVal URL As String, ByVal Flags As Long, ByVal TargetFrameName As String, PostData As Variant, ByVal Headers As String, Cancel As Boolean)End SubPrivate Sub sdf_Click()End SubPrivate Sub Command1_Click()
    WebBrowser1.Navigate "http://www.163.com"
    Timer1.Enabled = True
End SubPrivate Sub timer1_timer()
     WebBrowser1.Navigate "http://www.163.com"
    Timer1.Enabled = True
     End Sub
     Private Sub WebBrowser1_BeforeNavigate2(ByVal pDisp As Object, URL As Variant, Flags As Variant, TargetFrameName As Variant, PostData As Variant, Headers As Variant, Cancel As Boolean)
    Timer1.Enabled = False
End SubPrivate Sub WebBrowser1_DownloadComplete()
    Timer1.Enabled = True
End Subtimer取值范围0---65535
但是我现在在本程序中想要5分种。请问怎么实现呀。在线等待!

解决方案 »

  1.   

    设timer1的interval为1000,再设一个全局变量比如i ,在timer1.timer里加上下面程序:
    if i<300 then
       i=i+1
     else
       i=0
       '要执行的程序
       ......
    end if
    即让timer每触发300秒执行一次程序,不就达到5分钟的时间间隔了
      

  2.   

    同意 eplayboy,可以定义一个静态变量
      

  3.   

    有COM的实现方法
    如果想要
    留下邮箱
      

  4.   

    两个timer循环太浪费了吧,我建议在timer里面加一个延时就好了!
    Public Sub Delay(HowLong As Date)   '延时
       Dim temptime As Date
       temptime = DateAdd("s", HowLong, Now)
        While temptime > Now
            DoEvents '让 windows 去处理其他事
        Wend
    End Sub
    Private Sub Timer1_Timer()
    .......
    delay(65535)
    End Sub