我需要一些修正 VB.net Code Framework 2.0 制作注册系统
I need some correction VB.net Code Framework 2.0 making a register system
在我的程序中,我想在进度条完成时检查我的应用程序是否已注册。如果已注册(通过表格 1 中的标签文本选中),则应显示第二个文本框,如果未注册,则应显示第一个文本框
问题是我不想添加结尾if
,因为它会不断弹出文本框。
这是我的代码:
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
ProgressBar1.Value += 1
If ProgressBar1.Value =
ProgressBar1.Maximum Then
Timer1.Stop()
ProgressBar1.Value = ProgressBar1.Minimum
If Form1.Label4.Text = "Unregistered" Then
MsgBox("Exampletext", MsgBoxStyle.Information)
Me.Hide()
Else
MsgBox("Exampletext1", MsgBoxStyle.Information)
Hide()
End If
End Sub
End Class
顺便说一句:我不想在 framework 2.0
中制作它,但我制作了它,以使其更兼容旧的 Windows。
这就是正确缩进很重要的原因...
编译器认为Else
与第一个If
有关。
实际上,当您的第二个 If
正确时,什么也不会发生,因为没有 End If
。因此假设指令在同一行。
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
ProgressBar1.Value += 1
If ProgressBar1.Value = ProgressBar1.Maximum Then
Timer1.Stop()
ProgressBar1.Value = ProgressBar1.Minimum
If Form1.Label4.Text = "Unregistered" Then
MsgBox("Exampletext", MsgBoxStyle.Information)
Me.Hide()
Else
MsgBox("Exampletext1", MsgBoxStyle.Information)
Hide()
End If
End If 'You need to add the End If here
End Sub
但是我投票结束这个问题,因为它是一个打字错误...
在我的程序中,我想在进度条完成时检查我的应用程序是否已注册。如果已注册(通过表格 1 中的标签文本选中),则应显示第二个文本框,如果未注册,则应显示第一个文本框
问题是我不想添加结尾if
,因为它会不断弹出文本框。
这是我的代码:
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
ProgressBar1.Value += 1
If ProgressBar1.Value =
ProgressBar1.Maximum Then
Timer1.Stop()
ProgressBar1.Value = ProgressBar1.Minimum
If Form1.Label4.Text = "Unregistered" Then
MsgBox("Exampletext", MsgBoxStyle.Information)
Me.Hide()
Else
MsgBox("Exampletext1", MsgBoxStyle.Information)
Hide()
End If
End Sub
End Class
顺便说一句:我不想在 framework 2.0
中制作它,但我制作了它,以使其更兼容旧的 Windows。
这就是正确缩进很重要的原因...
编译器认为Else
与第一个If
有关。
实际上,当您的第二个 If
正确时,什么也不会发生,因为没有 End If
。因此假设指令在同一行。
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
ProgressBar1.Value += 1
If ProgressBar1.Value = ProgressBar1.Maximum Then
Timer1.Stop()
ProgressBar1.Value = ProgressBar1.Minimum
If Form1.Label4.Text = "Unregistered" Then
MsgBox("Exampletext", MsgBoxStyle.Information)
Me.Hide()
Else
MsgBox("Exampletext1", MsgBoxStyle.Information)
Hide()
End If
End If 'You need to add the End If here
End Sub
但是我投票结束这个问题,因为它是一个打字错误...