top of page

Public Class Form2

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click


        Form1.Show()
        Me.Hide()


    End Sub

    Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click


        'Addition of Fractions
        Dim a, b, c, d As Single   'Fraction Variables 
        Dim x, y As Single         'Fraction Sum Variables 
        Dim z As Single             'Fraction Decimal Variable 

        'Assign Variables to TextBox Value Fractions 
        a = TextBox1.Text
        b = TextBox2.Text
        c = TextBox3.Text
        d = TextBox4.Text

        'Assign Fraction Sums to Variables 
        x = ((a * d) + (c * b))
        y = (
b * d)

        'Assign Fraction Sums to Labels 
        Label1.Text = x
        Label2.Text = y

        'Assign Decimal Fraction Sum to Variable 
        z = (x / y)

        'Assign Decimal Fraction to Label 
        Label3.Text = z


    End Sub

    Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click

        TextBox1.Text = ""
        TextBox2.Text = ""
        TextBox3.Text = ""
        TextBox4.Text = ""

        Label1.Text = ""
        Label2.Text = ""
        Label3.Text = ""


    End Sub


End Class

Website Links-173.jpg
bottom of page