Private Sub Command1_Click()

    x = Val(Text2)
    y = Val(Text3)
    Text4.Text = x / (x + y) * 100
    Text5.Text = y / (x + y) * 100

End Sub

Private Sub Command2_Click()

    Text1.Text = ""
    Text2.Text = ""
    Text3.Text = ""
    Text4.Text = ""
    Text5.Text = ""

End Sub

Back to vb6 exercises