1

我正在为我的兄弟开发一个程序,向他展示 VB 是什么。我让我的朋友在这里帮助我,但现在在这些线路上运行时出现错误。

Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
    ProgressBar1.Increment(10)
End Sub

Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
    Timer1.Tick = 1000

    **Timer1.Start()**

End Sub

** 不在那里,我试图将其加粗。

它返回给我这个错误:

Error 1 'Public Event Tick(sender As Object, e As System.EventArgs)' is an event, and cannot be called directly. Use a 'RaiseEvent' statement to raise an event. C:\Users\Kyle\Desktop\Form1.vb 10 9 WindowsApplication1

4

1 回答 1

3

Tick是一个Event计时器。设置间隔使用Interval属性,或将其传递给构造函数。

    timer = New Timer(3000) 
    timer.Enabled = True 
于 2013-06-23T04:32:18.190 回答