close
成績檢查select


Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load


        L1.Text = "輸入成績"


        L2.Text = "評語"


    End Sub


 

 



 


    Private Sub T1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles T1.KeyPress

 



 


        If e.KeyChar = Chr(13) Then


            T1.SelectAll()


            Dim a = T1.Text


            Select Case a


                Case 90 To 100


                    L3.Text = T1.Text & "成績及格...等級為A!!!"


                    L3.ForeColor = Color.Blue


                Case 80 To 89


                    L3.Text = T1.Text & "成績及格...等級為B!!!"


                    L3.ForeColor = Color.Green


                Case 70 To 79


                    L3.Text = T1.Text & "成績及格...等級為C!!!"


                    L3.ForeColor = Color.Yellow


                Case 60 To 69


                    L3.Text = T1.Text & "成績及格...等級為D!!!"


                    L3.ForeColor = Color.Black


                Case 0 To 59


                    L3.Text = T1.Text & "成績不及格...等級為F!!!"


                    L3.ForeColor = Color.Red


            End Select


        End If


    End Sub


End Class


arrow
arrow
    全站熱搜
    創作者介紹
    創作者 allnewtim 的頭像
    allnewtim

    Timmilk

    allnewtim 發表在 痞客邦 留言(0) 人氣()