有人可以更正代码中的错误吗? “更新程序”是一个在打开主程序时打开的窗口。我是Visual Basic的新手,所以我向你寻求帮助。更新程序用于广告。我在YT拍摄广告我的节目。抱歉我的英语和语法,但我来自波兰。感谢。
Public Class updater
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PerplexButton1.Click
PerplexProgressBar1.Value = PerplexProgressBar1.Minimum
PerplexButton1.Visible = False
PerplexProgressBar1.Visible = True
PerplexLabel2.Visible = True
PerplexLabel3.Visible = True
Timer1.Start()
PerplexLabel3.Text = "Connecting to server."
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
PerplexProgressBar1.Increment(1)
If PerplexProgressBar1.Value = 10 Then
PerplexLabel3.Text = "Connecting to server.."
End If
If PerplexProgressBar1.Value = 20 Then
PerplexLabel3.Text = "Connecting to server..."
End If
If PerplexProgressBar1.Value = 50 Then
PerplexLabel3.Text = "Connected. Looking for updates..."
End If
If PerplexProgressBar1.Value = 100 Then
Timer1.Stop()
PerplexProgressBar1.Visible = False
PerplexLabel3.Text = "Important updates are available on server."
PerplexLabel1.Text = "Please download the updates to run the program now."
PerplexButton2.Visible = True
End If
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PerplexButton2.Click
PerplexButton2.Visible = False
PerplexProgressBar1.Visible = True
Timer2.Start()
PerplexProgressBar1.Value = PerplexProgressBar1.Minimum
PerplexLabel1.Text = "Program will download the updates from server."
PerplexLabel3.Text = "Downloading updates from server..."
End Sub
Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
PerplexProgressBar1.Increment(1)
If PerplexProgressBar1.Value = 40 Then
PerplexLabel3.Text = "Please wait... Program is updating..."
End If
If PerplexProgressBar1.Value = 100 Then
Timer2.Stop()
PerplexProgressBar1.Visible = False
PerplexLabel3.Text = "All updates have been downloaded right now."
PerplexLabel1.Text = "Program has been successfully updated, run it!"
PerplexButton3.Visible = True
End If
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PerplexButton3.Click
Me.Close()
main.Show()
End Sub
Private Sub updater_FormClosing(ByVal sender As System.Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles MyBase.FormClosing
Me.Opacity = 0
main.Enabled = True
main.Opacity = 1
End Sub
Private Sub updater_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
main.Show()
main.Enabled = False
main.Opacity = 0.9
End Sub
Private Function main() As Object
Throw New NotImplementedException
End Function
End Class
答案 0 :(得分:-2)
删除这行代码......它应该运行良好......
Private Function main() As Object
Throw New NotImplementedException
End Function