为什么这个视觉基本脚本不起作用?

时间:2016-06-25 07:43:31

标签: vb.net

我对这段基本的Visual Basic代码感到非常恼火 请帮忙。我已经看过YouTube和其他任何地方甚至vb网站!如果有人可以帮助我,我会非常感激

Public Class Form1
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
    MessageBox.Show("Hi!!")
    Timer1.Start()

End Sub

Private Sub ProgressBar1_Click(sender As Object, e As EventArgs) Handles ProgressBar1.Click
End Sub

Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
    ProgressBar1.Increment(1)
    If ProgressBar1.Value = 100 Then
        Timer1.Stop()
        MsgBox("Jeff")

    End If
End Sub

Private Sub CheckBox1_CheckedChanged(sender As Object, e As EventArgs)
End Sub


Private Function GetNumericUpDown1(v As Integer) As Boolean
End Function

Private Sub ListBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ListBox1.SelectedIndexChanged
    If ( : ( ) Then
        MessageBox.Show("Well Done!")


    End If
End Sub



Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
    MessageBox.Show("!!Stopped!!")
    Timer2.Stop()

End Sub

Private Sub Timer2_Tick(sender As Object, e As EventArgs) Handles Timer2.Tick
    ProgressBar2.Increment(0.6)
    If ProgressBar2.Value = 100 Then
        Timer2.Stop()
        MsgBox("Jeff")

    End If
End Sub


Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
    MessageBox.Show("!!Started!!")
    Timer2.Start()

End Sub

Private Sub SplitContainer1_Panel1_Paint(sender As Object, e As PaintEventArgs) Handles SplitContainer1.Panel1.Paint

End Sub

Private Sub NotifyIcon1_MouseDoubleClick(sender As Object, e As MouseEventArgs)

End Sub

Private Sub TreeView1_AfterSelect(sender As Object, e As TreeViewEventArgs)

End Sub




Private Sub Timer3_Tick(sender As Object, e As EventArgs) Handles Timer3.Tick
    ProgressBar3.Increment(1)
    If ProgressBar3.Value = 100 Then
        Timer3.Stop()


    End If
End Sub

Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
    Timer3.Start()


End Sub

Private Sub ProgressBar3_Click(sender As Object, e As EventArgs) Handles ProgressBar3.Click

End Sub
End Class
顺便说一下:这是我的第一篇文章,所以很可能是垃圾!!

2 个答案:

答案 0 :(得分:1)

我没有足够的评论意见。

首先,正如其他人所说,我们无法重新创建这个,因为我们不知道你的表格是什么样的,或者你期望它做什么。

其次,你应该在Project属性的Compile部分打开Option Strict,以避免像ProgressBar2.Increment(0.6)这样的技术错误,因为0.6不是一个有效的整数。

我把一个TabControl(你从未在OP中提到过)和3个标签以及你列出的各种按钮和进度条组合在一起,对我来说似乎是一种合乎逻辑的方式,并且它运行得很好。单击每个选项卡上的按钮,每个进度条最终达到100%。我不知道你还有什么期待。

答案 1 :(得分:0)

如果删除所有空的子侦听器和动作侦听器,则检测问题会更容易

相关问题