在VB窗口的TEXT文本框中显示数值A;
让数值A在半分钟内从0 累加到100;
请问程序该怎么写?

解决方案 »

  1.   

    Option Explicit
    Dim starttime As LongPrivate Sub Command1_Click()
        Text1 = 0
        Timer1.Interval = 300
        Timer1.Enabled = True
        starttime = Timer
    End SubPrivate Sub Form_Load()
        Timer1.Enabled = False
    End SubPrivate Sub Timer1_Timer()
        Label1 = Timer - starttime
        Text1 = Text1 + 1
        If Text1 = "100" Then Timer1.Enabled = False
    End Sub