代码如下:
Private Sub Form_Load()
mystr = Format(Date, "yyyy")
Text1.Text = mystr
mystr = Format(Date, "mm")
Text2.Text = mystr
mystr = Format(Date, "d")
Text3.Text = mystr
mystr = Format(Time, "hh:mm:ss")
Text4.Text = mystr
End Sub
timer控件的属性的enabled 设置为 true, interval设置为1000
为什么程序运行后 不跳动秒数  就是timer不执行的?
请高手们指教~

解决方案 »

  1.   

    这段代码应该放在Timer控件的Timer事件中,如:Private Sub Timer1_Timer()
        Text1.Text=Now
    End Sub
      

  2.   

    Private Sub Timer1_Timer()
        Dim mystr As String
        Dim i As Integer
        Timer1.Enabled = True
        mystr = Format(Date, "yyyy")
        Text1.Text = mystr
        mystr = Format(Date, "mm")
        Text2.Text = mystr
        mystr = Format(Date, "d")
        Text3.Text = mystr
        mystr = Format(Time, "hh:mm:ss")
        Text4.Text = mystr
    End Sub??不能动吗?可以的。
      

  3.   

    是能动了 我粗心了 忘记把时钟的interval打开了 呵呵 多谢各位~