Public Class Form1
Public nilai1, nilai2 As Decimal
Private Sub cleartext()
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
TextBox4.Text = ""
End Sub
Function luas(ByVal nilai1, ByVal nilai2)
luas = (nilai1 * nilai2)
End Function
Function kel()
kel = (2 * nilai1) + nilai2
End Function
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
cleartext()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
nilai1 = TextBox1.Text
nilai2 = TextBox2.Text
TextBox3.Text = luas(TextBox1.Text, TextBox2.Text)
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
nilai1 = TextBox1.Text
nilai2 = TextBox2.Text
TextBox4.Text = kel()
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
End
End Sub
End Class
Public nilai1, nilai2 As Decimal
Private Sub cleartext()
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
TextBox4.Text = ""
End Sub
Function luas(ByVal nilai1, ByVal nilai2)
luas = (nilai1 * nilai2)
End Function
Function kel()
kel = (2 * nilai1) + nilai2
End Function
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
cleartext()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
nilai1 = TextBox1.Text
nilai2 = TextBox2.Text
TextBox3.Text = luas(TextBox1.Text, TextBox2.Text)
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
nilai1 = TextBox1.Text
nilai2 = TextBox2.Text
TextBox4.Text = kel()
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
End
End Sub
End Class
atau donwload program nyah di link :
http://www.4shared.com/file/DFDKw58m/function.html
Tidak ada komentar:
Posting Komentar