Membuat Program Kalkulator Sederhana menggunakan Microsoft Visual Basic 2010 Express
Membuat Program Kalkulator Sederhana
menggunakan Microsoft Visual Basic 2010 Express
1.
Buka aplikasi Microsoft Visual Basic 2010 pada
PC/Laptop anda.
2.
Klik New Project.
Pilih Windows Forms Application dan isikan nama file
yang akan dibuat pada kolom Name.
Kemudian klik OK.
3.
Buatlah Design program seperti dibawah ini :
4.
Untuk coding lengkapnya adalah sebagai berikut
:
Public Class
Form1
Private Sub
Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
Button1.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
Button6.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
Button5.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
Button2.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
Button3.Click
TextBox1.Text = " "
TextBox2.Text = " "
TextBox3.Text = " "
End Sub
Private Sub
TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
TextBox1.TextChanged
End Sub
Private Sub
Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
Button4.Click
Me.Close()
End Sub
End Class
5. Selesai..
Selamat mencoba...
Komentar
Posting Komentar