关于如何显示已用时间
比如从开始使用一个软件开始统计,每时刻都能在软件的状态栏中显现出已用时间
帮帮忙~~谢谢~~
热情散分拉~

解决方案 »

  1.   

    启动时记录启动时间 D1
    ?DateDiff ("n",#2006-1-12 8:00:54 # ,now)
    msgbox DateDiff ("n",D1 ,now)
    弹出你运行了多少分钟
      

  2.   


    Dim dt As DatePrivate Sub Form_Load()
        Timer1.Interval=1000
        Timer1.Enabeld=True
        dt = Now
    End SubPrivate Sub Timer1_Timer()
        StatusBar1.Panels(2).Text = "已经运行了" & DateDiff("S", dt, Now) & "秒"
    End Sub
      

  3.   

    Dim i As long
    Private Sub Form_Load()
        Timer1.Interval=1000
        Timer1.Enabeld=True
    End SubPrivate Sub Timer1_Timer()    
        StatusBar1.Panels(2).Text = "已经运行了" & cstr(i) & "秒"
        i=i+1
    End Sub
      

  4.   

    Private m_RunTime As DatePrivate Sub Form_Load()
        m_RunTime = Now
    End SubPrivate Sub tmrMain_Timer()
        Static mClock       As Date
        Dim vClock          As Date
        Dim lTime As Long
        vClock = Now
        If Second(mClock) <> Second(vClock) Then        '&Atilde;&iquest;&Atilde;&euml;&frac14;ì&sup2;&acirc;
            lTime = DateDiff("s", m_RunTime, Now)
            
            stbMain.Panels(1).Text = "系统运行:" & lTime \ 86400 & "天" & (lTime Mod 86400) \ 360 & "小时" & (lTime Mod 360) \ 60 & "分钟"
            
            mClock = vClock
        End If
    End Sub