Page 51 - Programming VB.NET
P. 51

Code With VB .Net                                                               47




                 Private Sub btncase_Click(sender As
                 System.Object, e As System.EventArgs) Handles
                 btnresult.Click

                         Dim markah As Integer
                         markah = txtmark.Text

                         Select Case (markah)

                             Case 80 To 100

                                 lblgrade.Text = "A"

                             Case 60 To 79

                                 lblgrade.Text = "B"

                             Case 50 To 59
                                 lblgrade.Text = "C"

                             Case 40 To 49

                                 lblgrade.Text = "D"

                             Case 0 To 39

                                 lblgrade.Text = "FAIL"
                             Case Else

                                 lblgrade.Text = "WRONG INPUT"

                         End Select

                     End Sub
   46   47   48   49   50   51   52   53   54   55   56