Protected Sub Button31_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button31.Click
Dim a As Integer
If TextBox1.Text = "" Or TextBox2.Text = "" Then
MsgBox("请输入学生姓名或成绩!")
Exit Sub
End If
a = CInt(TextBox2.Text)
If 0 < a And a < 61 Then
TextBox3.Text = TextBox1.Text & "--" & "不及格"
ElseIf 60 < a And a < 71 Then
TextBox3.Text = TextBox1.Text & "--" & "及格"
ElseIf 70 < a And a < 81 Then
TextBox3.Text = TextBox1.Text & "--" & "中"
ElseIf 80 < a And a < 91 Then
TextBox3.Text = TextBox1.Text & "--" & "良"
ElseIf 90 < a And a < 100 Then
TextBox3.Text = TextBox1.Text & "--" & "优"
End If
End Sub
这是按钮的后台代码
3个文本框和标签就照你的图做就可以了
有问题再在线联系....
温馨提示:答案为网友推荐,仅供参考