我正在使用 Visual Basic.NET,并且正在为足球裁判制作一个 Payscale 程序,您可以在其中输入您的年龄,它会告诉您您赚了多少。与经典足球相比,休闲足球向裁判支付更少的薪水。我有一个 Rec 和一个经典菜单。我这样做是为了让代码自动使用 Rec Payscale,当我单击经典菜单并输入年龄以尝试给我更新的工资时,它仍然给我 Rec Pay。我怎样才能做到这一点,当我单击该菜单然后输入年龄时,它会给我经典的工资表而不是记录工资表?
Public Class Form1
Private Sub txtanswer_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtanswer.TextChanged
If txtanswer.Text = "U8" Then
lblanswer.Text = "$16"
End If
If txtanswer.Text = "U9" Or txtanswer.Text = "U10" Then
lblanswer.Text = "Center - $20, AR - $10"
End If
If txtanswer.Text = "U11" Or txtanswer.Text = "U12" Then
lblanswer.Text = "Center - $22, AR - $12"
End If
If txtanswer.Text = "U13" Or txtanswer.Text = "U14" Then
lblanswer.Text = "Center - $24, AR - $14"
End If
If txtanswer.Text = "U15" Or txtanswer.Text = "U16" Then
lblanswer.Text = "Center - $26, AR - $16"
End If
If txtanswer.Text = "U17" Or txtanswer.Text = "U18" Then
lblanswer.Text = "Center - $30, AR - $20"
End If
End Sub
Private Sub ClassicToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ClassicToolStripMenuItem.Click
If txtanswer.Text = "U11" Or txtanswer.Text = "U12" Then
lblanswer.Text = "Center - $25, AR - $15"
End If
If txtanswer.Text = "U13" Or txtanswer.Text = "U14" Then
lblanswer.Text = "Center - $30, AR - $18"
End If
If txtanswer.Text = "U15" Or txtanswer.Text = "U16" Then
lblanswer.Text = "Center - $34, AR - $20"
End If
If txtanswer.Text = "U17" Or txtanswer.Text = "U18" Then
lblanswer.Text = "Center - $38, AR - $22"
End If
End Sub
End Class