Sahabat-sahabat yang sudah punya aplikasi visual basic 2010 atau juga
disebut VB.net tetapi tidak paham bagaimana cara penggunaannya, saya
akan memperjelasnya. Sebenarnya visual Basic 2010 memiliki konsep yang
sama dengan visual basic 2006 (VB 6). Visual Basic adalah sebuah program
yang berguna untuk mengembangkan suatu program (debugging). Nah
langsung saja ke dalam Prosesnya, Anda harus teliti dalam bekerja,
jangan mudah putus asa dan terus semangat.
Bahan – Bahan:
-Visual Basic 2010 Express
-Kesabaran dan Ketelitian
Component yang dibutuhkan pada Visual Basic adalah..:
- 4 buah Label
- 3 buah Group Box
-10 Buah Button
Langkah langkah:
Disain.lah form seperti pada gambar dibawah :
Setelah itu, masukkan kode berikut (Tekan F7 Untuk masuk ke dalam coding, atau dobel klik pada objek yang dimaksud)
Public Class Form1
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Button3.Enabled = False
Button4.Enabled = False
Button5.Enabled = False
Button6.Enabled = False
Button7.Enabled = False
Button8.Enabled = False
Button9.Enabled = False
Button10.Enabled = False
TextBox1.Enabled = False
TextBox2.Enabled = False
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Label4.Text = Val(TextBox1.Text) + Val(TextBox2.Text)
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
Label4.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
Label4.Text = “”
TextBox1.Text = “”
TextBox2.Text = “”
End Sub
Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
Label4.Text = Val(TextBox1.Text) * Val(TextBox2.Text)
End Sub
Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click
Label4.Text = Val(TextBox1.Text) / Val(TextBox2.Text)
End Sub
Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click
Label4.Text = Val(TextBox1.Text) ^ 2
End Sub
Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button9.Click
Label4.Text = Val(TextBox1.Text) Mod Val(TextBox2.Text)
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Button3.Enabled = True
Button4.Enabled = True
Button5.Enabled = True
Button6.Enabled = True
Button7.Enabled = True
Button8.Enabled = True
Button9.Enabled = True
Button10.Enabled = True
TextBox1.Enabled = True
TextBox2.Enabled = True
End Sub
Private Sub Button10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button10.Click
Label4.Text = Val(TextBox1.Text) ^ Val(TextBox2.Text)
End Sub
End Class
Jangan Lupa juga mengatur maxlength menjadi 12 digit.,
No comments:
Post a Comment