Public Function fpembayaran(ByVal bil1 As Integer, ByVal bil2 As Integer, ByVal bil3 As Integer, ByVal bil4 As Integer) As Integer
fpembayaran = Val(bil1) + Val(bil2) + Val(bil3) + Val(bil4)
End Function
End Class


Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim obj As New Class1
Label9.Text = obj.fpembayaran(TextBox1.Text, TextBox2.Text, TextBox3.Text, TextBox4.Text)
MsgBox("Total Harga adalah Rp " + Label9.Text + " ")
End Sub
End Class