SCRIPT PEMBUATAN CALCULATOR VB.NET
Public Class calculator
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tambah.Click
TextBox3.Text = Val(TextBox1.Text) + Val(TextBox2.Text)
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles kurang.Click
TextBox3.Text = Val(TextBox1.Text) - Val(TextBox2.Text)
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles kali.Click
TextBox3.Text = Val(TextBox1.Text) * Val(TextBox2.Text)
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bagi.Click
TextBox3.Text = Val(TextBox1.Text) / Val(TextBox2.Text)
End Sub
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles pangkat.Click
TextBox3.Text = Val(TextBox1.Text) ^ Val(TextBox2.Text)
End Sub
Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mods.Click
TextBox3.Text = Val(TextBox1.Text) Mod Val(TextBox2.Text)
End Sub
Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bersih.Click
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
End Sub
Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles keluar.Click
Me.Close()
End Sub
End Class
Public Class calculator
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tambah.Click
TextBox3.Text = Val(TextBox1.Text) + Val(TextBox2.Text)
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles kurang.Click
TextBox3.Text = Val(TextBox1.Text) - Val(TextBox2.Text)
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles kali.Click
TextBox3.Text = Val(TextBox1.Text) * Val(TextBox2.Text)
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bagi.Click
TextBox3.Text = Val(TextBox1.Text) / Val(TextBox2.Text)
End Sub
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles pangkat.Click
TextBox3.Text = Val(TextBox1.Text) ^ Val(TextBox2.Text)
End Sub
Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mods.Click
TextBox3.Text = Val(TextBox1.Text) Mod Val(TextBox2.Text)
End Sub
Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bersih.Click
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
End Sub
Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles keluar.Click
Me.Close()
End Sub
End Class
vb.net
01.21
0 Responses to "Membuat Kalkulator Dengan VB.Net"
Posting Komentar