0

Hey Guys Today  I Will Tell You How To Develop Your Own GPA Calculator.
I Upload A Simple GPA Calculator With Source Code IN VB 2010.

Using This Calculator You Will Be able To Calculate You GPA By Just Selecting You Marks From The Combo Box Of Marks And Select Credit Hours.
Hope You Enjoy My Code..
I You Feel Any Difficulty In Understanding My Code Feel Free To Comment.
Thanks 

Download  Here Complete Project Click Me

Execute able is inside the project


Password = ahmedhaseeb.blogspot.com

Source Code

Public Class Form1
    Dim count As Integer
    Dim sub1 As Double
    Dim sub2 As Double
    Dim sub3 As Double
    Dim sub4 As Double
    Dim sub5 As Double
    Dim sub6 As Double
    Dim sub7 As Double
    Dim sub8 As Double
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        count = 1
        CheckBox2.Enabled = True
    End Sub

  

    Private Sub CheckBox1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged
        If CheckBox1.CheckState = CheckState.Checked Then
            count = count + 1
            '            MsgBox(Val(count))
            ComboBox1.Enabled = True
            ComboBox16.Enabled = True
            Lsub1.Enabled = True
            TBox1.Enabled = True
            CheckBox2.Enabled = True
        ElseIf CheckBox1.CheckState = CheckState.Unchecked Then
            count = count - 1
            '           MsgBox(Val(count))
            ComboBox16.Enabled = False
            ComboBox1.Enabled = False
            Lsub1.Enabled = False
            TBox1.Enabled = False
            CheckBox2.Checked = False
            CheckBox2.Enabled = False
        End If

    End Sub

    Private Sub CheckBox2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox2.CheckedChanged
        If CheckBox2.CheckState = CheckState.Checked Then
            count = count + 1
            Lsub2.Enabled = True
            TBox2.Enabled = True
            ComboBox2.Enabled = True
            ComboBox15.Enabled = True
            CheckBox3.Enabled = True
        ElseIf CheckBox2.Checked = False Then
            count = count - 1
            Lsub2.Enabled = False
            TBox2.Enabled = False
            ComboBox2.Enabled = False
            ComboBox15.Enabled = False
            CheckBox3.Checked = False
            CheckBox3.Enabled = False
        End If
    End Sub

    Private Sub CheckBox3_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox3.CheckedChanged
        If CheckBox3.Checked = True Then
            count = count + 1
            Lsub3.Enabled = True
            TBox3.Enabled = True
            ComboBox3.Enabled = True
            ComboBox14.Enabled = True
            CheckBox4.Enabled = True
        ElseIf CheckBox3.Checked = False Then
            count = count - 1
            Lsub3.Enabled = False
            TBox3.Enabled = False
            ComboBox3.Enabled = False
            ComboBox14.Enabled = False
            CheckBox4.Checked = False
            CheckBox4.Enabled = False
        End If
    End Sub

    Private Sub CheckBox4_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox4.CheckedChanged
        If CheckBox4.Checked = True Then
            count = count + 1
            Lsub4.Enabled = True
            TBox4.Enabled = True
            ComboBox4.Enabled = True
            ComboBox13.Enabled = True
            CheckBox5.Enabled = True
        ElseIf CheckBox4.Checked = False Then
            count = count - 1
            Lsub4.Enabled = False
            TBox4.Enabled = False
            ComboBox4.Enabled = False
            ComboBox13.Enabled = False
            CheckBox5.Checked = False
            CheckBox5.Enabled = False
        End If
    End Sub

    Private Sub CheckBox5_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox5.CheckedChanged
        If CheckBox5.Checked = True Then
            count = count + 1
            Lsub5.Enabled = True
            TBox5.Enabled = True
            ComboBox5.Enabled = True
            ComboBox12.Enabled = True
            CheckBox6.Enabled = True
        ElseIf CheckBox5.Checked = False Then
            count = count - 1
            Lsub5.Enabled = False
            TBox5.Enabled = False
            ComboBox5.Enabled = False
            ComboBox12.Enabled = False
            CheckBox6.Checked = False
            CheckBox6.Enabled = False
        End If
    End Sub

    Private Sub CheckBox6_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox6.CheckedChanged
        If CheckBox6.Checked = True Then
            count = count + 1
            Lsub6.Enabled = True
            TBox6.Enabled = True
            ComboBox6.Enabled = True
            ComboBox11.Enabled = True
            CheckBox7.Enabled = True
        ElseIf CheckBox6.Checked = False Then
            count = count - 1
            Lsub6.Enabled = False
            TBox6.Enabled = False
            ComboBox6.Enabled = False
            ComboBox11.Enabled = False

            CheckBox7.Checked = False
            CheckBox7.Enabled = False
        End If
    End Sub

    Private Sub CheckBox7_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox7.CheckedChanged
        If CheckBox7.Checked = True Then
            count = count + 1
            Lsub7.Enabled = True
            TBox7.Enabled = True
            ComboBox7.Enabled = True
            ComboBox10.Enabled = True
            CheckBox8.Enabled = True
        ElseIf CheckBox7.Checked = False Then
            count = count - 1
            Lsub7.Enabled = False
            TBox7.Enabled = False
            ComboBox7.Enabled = False
            ComboBox10.Enabled = False

            CheckBox8.Checked = False
            CheckBox8.Enabled = False
        End If
    End Sub

    Private Sub CheckBox8_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox8.CheckedChanged
        If CheckBox8.Checked = True Then
            count = count + 1
            '       MsgBox(Val(count))
            Lsub8.Enabled = True
            TBox8.Enabled = True
            ComboBox8.Enabled = True
            ComboBox9.Enabled = True
        ElseIf CheckBox8.Checked = False Then
            count = count - 1
            '        MsgBox(Val(count))
            Lsub8.Enabled = False
            TBox8.Enabled = False
            ComboBox8.Enabled = False
            ComboBox9.Enabled = False
        End If
    End Sub

    Private Sub TextBox8_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)

    End Sub

    Private Sub ContextMenuStrip1_Opening(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles ContextMenuStrip1.Opening

    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Close()
    End Sub

    Private Sub FacebookToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles FacebookToolStripMenuItem.Click
        MsgBox("http://www.facebook.com/ahmedhaseebyaqoob", , "Facebook Information")
    End Sub
    Private Sub GoogleTalkToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GoogleTalkToolStripMenuItem.Click
        MsgBox("http://www.Google.com/+Ahmedhaseeb" & vbNewLine & "Ahmedhaseeb123@gmail.com ", , "Google Information")
    End Sub

    Private Sub SkypeToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SkypeToolStripMenuItem.Click
        MsgBox("Skype Name: ahmedhaseeb007", , "Skype Information")
    End Sub

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        Time.Text = TimeOfDay

    End Sub

    Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
        If ComboBox1.SelectedIndex = 0 Then
            TBox1.Text = "A+"
            sub1 = 4
            TBox1.BackColor = Color.Green
        ElseIf ComboBox1.SelectedIndex = 1 Then
            TBox1.Text = "A"
            sub1 = 3.7
            TBox1.BackColor = Color.Green
        ElseIf ComboBox1.SelectedIndex = 2 Then
            TBox1.Text = "B+"
            sub1 = 3.4
            TBox1.BackColor = Color.Orange
        ElseIf ComboBox1.SelectedIndex = 3 Then
            TBox1.Text = "B"
            sub1 = 3.0
            TBox1.BackColor = Color.Orange
        ElseIf ComboBox1.SelectedIndex = 4 Then
            TBox1.Text = "B-"
            sub1 = 2.5
            TBox1.BackColor = Color.Orange
        ElseIf ComboBox1.SelectedIndex = 5 Then
            TBox1.Text = "C+"
            sub1 = 2.0
            TBox1.BackColor = Color.Yellow
        ElseIf ComboBox1.SelectedIndex = 6 Then
            TBox1.Text = "C"
            sub1 = 1.5
            TBox1.BackColor = Color.Yellow
        ElseIf ComboBox1.SelectedIndex = 7 Then
            TBox1.Text = "D"
            sub1 = 1.0
            TBox1.BackColor = Color.Red
        ElseIf ComboBox1.SelectedIndex = 8 Then
            TBox1.Text = "F"
            sub1 = 0.0
            TBox1.BackColor = Color.Red
        End If
    End Sub

    Private Sub TBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TBox1.TextChanged

    End Sub

    Private Sub ComboBox2_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox2.SelectedIndexChanged
        If ComboBox2.SelectedIndex = 0 Then
            sub2 = 4
            TBox2.Text = "A+"
            TBox2.BackColor = Color.Green
        ElseIf ComboBox2.SelectedIndex = 1 Then
            sub2 = 3.7
            TBox2.Text = "A"
            TBox2.BackColor = Color.Green
        ElseIf ComboBox2.SelectedIndex = 2 Then
            sub2 = 3.4
            TBox2.Text = "B+"
            TBox2.BackColor = Color.Orange
        ElseIf ComboBox2.SelectedIndex = 3 Then
            sub2 = 3.0
            TBox2.Text = "B"
            TBox2.BackColor = Color.Orange
        ElseIf ComboBox2.SelectedIndex = 4 Then
            sub2 = 2.5
            TBox2.Text = "B-"
            TBox2.BackColor = Color.Orange
        ElseIf ComboBox2.SelectedIndex = 5 Then
            sub2 = 2.0
            TBox2.Text = "C+"
            TBox2.BackColor = Color.Yellow
        ElseIf ComboBox2.SelectedIndex = 6 Then
            sub2 = 1.5
            TBox2.Text = "C"
            TBox2.BackColor = Color.Yellow
        ElseIf ComboBox2.SelectedIndex = 7 Then
            sub2 = 1.0
            TBox2.Text = "D"
            TBox2.BackColor = Color.Red
        ElseIf ComboBox2.SelectedIndex = 8 Then
            sub2 = 0.0
            TBox2.Text = "F"
            TBox2.BackColor = Color.Red
        End If
    End Sub

    Private Sub ComboBox3_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox3.SelectedIndexChanged
        If ComboBox3.SelectedIndex = 0 Then
            sub3 = 4.0
            TBox3.Text = "A+"
            TBox3.BackColor = Color.Green
        ElseIf ComboBox3.SelectedIndex = 1 Then
            sub3 = 3.7
            TBox3.Text = "A"
            TBox3.BackColor = Color.Green
        ElseIf ComboBox3.SelectedIndex = 2 Then
            sub3 = 3.4
            TBox3.Text = "B+"
            TBox3.BackColor = Color.Orange
        ElseIf ComboBox3.SelectedIndex = 3 Then
            sub3 = 3.0
            TBox3.Text = "B"
            TBox3.BackColor = Color.Orange
        ElseIf ComboBox3.SelectedIndex = 4 Then
            sub3 = 2.5
            TBox3.Text = "B-"
            TBox3.BackColor = Color.Orange
        ElseIf ComboBox3.SelectedIndex = 5 Then
            sub3 = 2.0
            TBox3.Text = "C+"
            TBox3.BackColor = Color.Yellow
        ElseIf ComboBox3.SelectedIndex = 6 Then
            sub3 = 1.5
            TBox3.Text = "C"
            TBox3.BackColor = Color.Yellow
        ElseIf ComboBox3.SelectedIndex = 7 Then
            sub3 = 1.0
            TBox3.Text = "D"
            TBox3.BackColor = Color.Red
        ElseIf ComboBox3.SelectedIndex = 8 Then
            sub3 = 0.0
            TBox3.Text = "F"
            TBox3.BackColor = Color.Red
        End If
    End Sub

    Private Sub ComboBox4_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox4.SelectedIndexChanged
        If ComboBox4.SelectedIndex = 0 Then
            sub4 = 4.0
            TBox4.Text = "A+"
            TBox4.BackColor = Color.Green
        ElseIf ComboBox4.SelectedIndex = 1 Then
            sub4 = 3.7
            TBox4.Text = "A"
            TBox4.BackColor = Color.Green
        ElseIf ComboBox4.SelectedIndex = 2 Then
            sub4 = 3.4
            TBox4.Text = "B+"
            TBox4.BackColor = Color.Orange
        ElseIf ComboBox4.SelectedIndex = 3 Then
            sub4 = 3.0
            TBox4.Text = "B"
            TBox4.BackColor = Color.Orange
        ElseIf ComboBox4.SelectedIndex = 4 Then
            sub4 = 2.5
            TBox4.Text = "B-"
            TBox4.BackColor = Color.Orange
        ElseIf ComboBox4.SelectedIndex = 5 Then
            sub4 = 2.0
            TBox4.Text = "C+"
            TBox4.BackColor = Color.Yellow
        ElseIf ComboBox4.SelectedIndex = 6 Then
            sub4 = 1.5
            TBox4.Text = "C"
            TBox4.BackColor = Color.Yellow
        ElseIf ComboBox4.SelectedIndex = 7 Then
            sub4 = 1.0
            TBox4.Text = "D"
            TBox4.BackColor = Color.Red
        ElseIf ComboBox4.SelectedIndex = 8 Then
            sub4 = 0.0
            TBox4.Text = "F"
            TBox4.BackColor = Color.Red
        End If
    End Sub

    Private Sub ComboBox5_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox5.SelectedIndexChanged
        If ComboBox5.SelectedIndex = 0 Then
            sub5 = 4.0
            TBox5.Text = "A+"
            TBox5.BackColor = Color.Green
        ElseIf ComboBox5.SelectedIndex = 1 Then
            sub5 = 3.7
            TBox5.Text = "A"
            TBox5.BackColor = Color.Green
        ElseIf ComboBox5.SelectedIndex = 2 Then
            sub5 = 3.4
            TBox5.Text = "B+"
            TBox5.BackColor = Color.Orange
        ElseIf ComboBox5.SelectedIndex = 3 Then
            sub5 = 3.0
            TBox5.Text = "B"
            TBox5.BackColor = Color.Orange
        ElseIf ComboBox5.SelectedIndex = 4 Then
            sub5 = 2.5
            TBox5.Text = "B-"
            TBox5.BackColor = Color.Orange
        ElseIf ComboBox5.SelectedIndex = 5 Then
            sub5 = 2.0
            TBox5.Text = "C+"
            TBox5.BackColor = Color.Yellow
        ElseIf ComboBox5.SelectedIndex = 6 Then
            sub5 = 1.5
            TBox5.Text = "C"
            TBox5.BackColor = Color.Yellow
        ElseIf ComboBox5.SelectedIndex = 7 Then
            sub5 = 1.0
            TBox5.Text = "D"
            TBox5.BackColor = Color.Red
        ElseIf ComboBox5.SelectedIndex = 8 Then
            sub5 = 0.0
            TBox5.Text = "F"
            TBox5.BackColor = Color.Red
        End If
    End Sub

    Private Sub ComboBox6_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox6.SelectedIndexChanged
        If ComboBox6.SelectedIndex = 0 Then
            sub6 = 4.0
            TBox6.Text = "A+"
            TBox6.BackColor = Color.Green
        ElseIf ComboBox6.SelectedIndex = 1 Then
            sub6 = 3.7
            TBox6.Text = "A"
            TBox6.BackColor = Color.Green
        ElseIf ComboBox6.SelectedIndex = 2 Then
            sub6 = 3.4
            TBox6.Text = "B+"
            TBox6.BackColor = Color.Orange
        ElseIf ComboBox6.SelectedIndex = 3 Then
            sub6 = 3.0
            TBox6.Text = "B"
            TBox6.BackColor = Color.Orange
        ElseIf ComboBox6.SelectedIndex = 4 Then
            sub6 = 2.5
            TBox6.Text = "B-"
            TBox6.BackColor = Color.Orange
        ElseIf ComboBox6.SelectedIndex = 5 Then
            sub6 = 2.0
            TBox6.Text = "C+"
            TBox6.BackColor = Color.Yellow
        ElseIf ComboBox6.SelectedIndex = 6 Then
            sub6 = 1.5
            TBox6.Text = "C"
            TBox6.BackColor = Color.Yellow
        ElseIf ComboBox6.SelectedIndex = 7 Then
            sub6 = 1.0
            TBox6.Text = "D"
            TBox6.BackColor = Color.Red
        ElseIf ComboBox6.SelectedIndex = 8 Then
            sub6 = 0.0
            TBox6.Text = "F"
            TBox6.BackColor = Color.Red
        End If
    End Sub

    Private Sub ComboBox7_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox7.SelectedIndexChanged
        If ComboBox7.SelectedIndex = 0 Then
            sub7 = 4.0
            TBox7.Text = "A+"
            TBox7.BackColor = Color.Green
        ElseIf ComboBox7.SelectedIndex = 1 Then
            sub7 = 3.7
            TBox7.Text = "A"
            TBox7.BackColor = Color.Green
        ElseIf ComboBox7.SelectedIndex = 2 Then
            sub7 = 3.4
            TBox7.Text = "B+"
            TBox7.BackColor = Color.Orange
        ElseIf ComboBox7.SelectedIndex = 3 Then
            sub7 = 3.0
            TBox7.Text = "B"
            TBox7.BackColor = Color.Orange
        ElseIf ComboBox7.SelectedIndex = 4 Then
            sub7 = 2.5
            TBox7.Text = "B-"
            TBox7.BackColor = Color.Orange
        ElseIf ComboBox7.SelectedIndex = 5 Then
            sub7 = 2.0
            TBox7.Text = "C+"
            TBox7.BackColor = Color.Yellow
        ElseIf ComboBox7.SelectedIndex = 6 Then
            sub7 = 1.5
            TBox7.Text = "C"
            TBox7.BackColor = Color.Yellow
        ElseIf ComboBox7.SelectedIndex = 7 Then
            sub7 = 1.0
            TBox7.Text = "D"
            TBox7.BackColor = Color.Red
        ElseIf ComboBox7.SelectedIndex = 8 Then
            sub7 = 0.0
            TBox7.Text = "F"
            TBox7.BackColor = Color.Red
        End If
    End Sub

    Private Sub ComboBox8_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox8.SelectedIndexChanged

        If ComboBox8.SelectedIndex = 0 Then
            sub8 = 4.0
            TBox8.Text = "A+"
            TBox8.BackColor = Color.Green
        ElseIf ComboBox8.SelectedIndex = 1 Then
            sub8 = 3.7
            TBox8.Text = "A"
            TBox8.BackColor = Color.Green
        ElseIf ComboBox8.SelectedIndex = 2 Then
            sub8 = 3.4
            TBox8.Text = "B+"
            TBox8.BackColor = Color.Orange
        ElseIf ComboBox8.SelectedIndex = 3 Then
            sub8 = 3.0
            TBox8.Text = "B"
            TBox8.BackColor = Color.Orange
        ElseIf ComboBox8.SelectedIndex = 4 Then
            sub8 = 2.5
            TBox8.Text = "B-"
            TBox8.BackColor = Color.Orange
        ElseIf ComboBox8.SelectedIndex = 5 Then
            sub8 = 2.0
            TBox8.Text = "C+"
            TBox8.BackColor = Color.Yellow
        ElseIf ComboBox8.SelectedIndex = 6 Then
            sub8 = 1.5
            TBox8.Text = "C"
            TBox8.BackColor = Color.Yellow
        ElseIf ComboBox8.SelectedIndex = 7 Then
            sub8 = 1.0
            TBox8.Text = "D"
            TBox8.BackColor = Color.Red
        ElseIf ComboBox8.SelectedIndex = 8 Then
            sub8 = 0.0
            TBox8.Text = "F"
            TBox8.BackColor = Color.Red
        End If
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim sumgrade As Double
        Dim chrs As Double
        ' chrs = 0
        'sumgrade = 0
        If count = 1 Then
            sumgrade = Val(ComboBox16.Text)
            chrs = Val(ComboBox16.Text)
            GPA.Text = (sub1 * sumgrade) / chrs
        ElseIf count = 2 Then
            sumgrade = (Val(ComboBox16.Text) * sub1) + (Val(ComboBox15.Text) * sub2)
            chrs = Val(ComboBox16.Text) + Val(ComboBox15.Text)
            GPA.Text = sumgrade / chrs
        ElseIf count = 3 Then
            sumgrade = (Val(ComboBox16.Text) * sub1) + (Val(ComboBox15.Text) * sub2) + (Val(ComboBox14.Text) * sub3)
            chrs = Val(ComboBox16.Text) + Val(ComboBox15.Text) + Val(ComboBox14.Text)
            GPA.Text = sumgrade / chrs
        ElseIf count = 4 Then
            sumgrade = (Val(ComboBox16.Text) * sub1) + (Val(ComboBox15.Text) * sub2) + (Val(ComboBox14.Text) * sub3) + (Val(ComboBox13.Text) * sub4)
            chrs = Val(ComboBox16.Text) + Val(ComboBox15.Text) + Val(ComboBox14.Text) + Val(ComboBox13.Text)
            GPA.Text = sumgrade / chrs
        ElseIf count = 5 Then
            sumgrade = (Val(ComboBox16.Text) * sub1) + (Val(ComboBox15.Text) * sub2) + (Val(ComboBox14.Text) * sub3) + (Val(ComboBox13.Text) * sub4) + (Val(ComboBox12.Text) * sub5)
            chrs = Val(ComboBox16.Text) + Val(ComboBox15.Text) + Val(ComboBox14.Text) + Val(ComboBox13.Text) + Val(ComboBox12.Text)
            GPA.Text = sumgrade / chrs
        ElseIf count = 6 Then
            sumgrade = (Val(ComboBox16.Text) * sub1) + (Val(ComboBox15.Text) * sub2) + (Val(ComboBox14.Text) * sub3) + (Val(ComboBox13.Text) * sub4) + (Val(ComboBox12.Text) * sub5) + (Val(ComboBox11.Text) * sub6)
            chrs = Val(ComboBox16.Text) + Val(ComboBox15.Text) + Val(ComboBox14.Text) + Val(ComboBox13.Text) + Val(ComboBox12.Text) + Val(ComboBox11.Text)
            GPA.Text = sumgrade / chrs
        ElseIf count = 7 Then
            sumgrade = (Val(ComboBox16.Text) * sub1) + (Val(ComboBox15.Text) * sub2) + (Val(ComboBox14.Text) * sub3) + (Val(ComboBox13.Text) * sub4) + (Val(ComboBox12.Text) * sub5) + (Val(ComboBox11.Text) * sub6) + (Val(ComboBox10.Text) * sub7)
            chrs = Val(ComboBox16.Text) + Val(ComboBox15.Text) + Val(ComboBox14.Text) + Val(ComboBox13.Text) + Val(ComboBox12.Text) + Val(ComboBox11.Text) + Val(ComboBox10.Text)
            GPA.Text = sumgrade / chrs
        ElseIf count = 8 Then
            sumgrade = (Val(ComboBox16.Text) * sub1) + (Val(ComboBox15.Text) * sub2) + (Val(ComboBox14.Text) * sub3) + (Val(ComboBox13.Text) * sub4) + (Val(ComboBox12.Text) * sub5) + (Val(ComboBox11.Text) * sub6) + (Val(ComboBox10.Text) * sub7) + (Val(ComboBox9.Text) * sub8)
            chrs = Val(ComboBox16.Text) + Val(ComboBox15.Text) + Val(ComboBox14.Text) + Val(ComboBox13.Text) + Val(ComboBox12.Text) + Val(ComboBox11.Text) + Val(ComboBox10.Text) + Val(ComboBox9.Text)
            GPA.Text = sumgrade / chrs
        End If


        ' For Coloring
        If Val(GPA.Text) >= 4 Then
            GPA.BackColor = Color.Green
        ElseIf Val(GPA.Text) >= 3.5 Then
            GPA.BackColor = Color.Green

        ElseIf Val(GPA.Text) >= 3 Then
            GPA.BackColor = Color.Yellow
        ElseIf Val(GPA.Text) >= 2 Then
            GPA.BackColor = Color.Orange
        ElseIf Val(GPA.Text) >= 1 Then
            GPA.BackColor = Color.Red
        ElseIf Val(GPA.Text) >= 0 Then
            GPA.BackColor = Color.Red

        End If
    End Sub

    Private Sub GPA_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GPA.TextChanged

    End Sub

   
    Private Sub Time_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Time.Click

    End Sub
End Class

Post a Comment

 
Top