我的源代码存在问题。我正在使用Visual Basic 2008 Express Edition,我想为我的最终项目制作一个闹钟。这是我的代码:
Public Class Form1
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
OpenFileDialog1.ShowDialog()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Timer2.Enabled = True
If TextBox1.Text = "00:00:00" Then
MsgBox("Insert Time")
End If
MsgBox("Alarm On")
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Timer2.Enabled = False
Timer1.Enabled = True
MsgBox("Alarm Off")
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
ComboBox1.Visible = True
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
ComboBox1.Visible = False
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Label1.Text = TimeString
End Sub
Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
If TextBox1.Text = Label1.Text Then
Timer1.Enabled = False
AxWindowsMediaPlayer1.URL = ComboBox1.SelectedItem
TextBox1.Clear()
End If
End Sub
Private Sub OpenFileDialog1_FileOk(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles OpenFileDialog1.FileOk
For Each track As String In OpenFileDialog1.FileNames
ComboBox1.Items.Add(track)
Next
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Label1.Text = TimeOfDay
End Sub
End Class
那里有三个错误。