我的第一个VB程序,错误

时间:2013-06-23 04:27:49

标签: vb.net

我正在为我的兄弟制作一个程序,向他展示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

1 个答案:

答案 0 :(得分:3)

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

    timer = New Timer(3000) 
    timer.Enabled = True