SAlam Jumpa Kembalai Para Mahasiswa Mallkom Gorontalo serta semua sahabat blogger sedunia kali ini saya akan berbagi sedikit pengetahuan pemrograman visual basic dengan topik input output..ok langsung aja..
1. Buatlah sebuah aplikasi baru (File | New
Project | Standard EXE)
2. Masukkan 3 label, 3 Textbox, 6
commandbutton
Object
|
Properties
|
Value
|
Label1
|
Caption
|
Bilangan 1
|
Label2
|
Caption
|
Bilangan 2
|
Label 3
|
Caption
|
Hasil Proses
|
Textbox1
|
Name
|
Txtbil1
|
Textbox2
|
Name
|
Txtbil2
|
Textbox3
|
Name
|
Txthasil
|
Command1
|
Caption
|
+
|
Command2
|
Caption
|
-
|
Command3
|
Caption
|
X
|
Command4
|
Caption
|
/
|
Command5
|
Caption
|
&Baru
|
Command6
|
Caption
|
&Keluar
|
4. Masukan code untuk masing-masing
event sebagai berikut :
Private Sub Form_Activate()
txtbil1.Text = 0
txtbil2.Text = 0
txthasil.Text = 0
txtbil1.SetFocus
End Sub
Private Sub Command1_Click()
‘button
tambah
txthasil.Text = Val(txtbil1.Text) + Val(txtbil2.Text)
End Sub
Private Sub Command2_Click()
‘button
Kurang
txthasil.Text = Val(txtbil1.Text) - Val(txtbil2.Text)
End Sub
Private Sub Command3_Click()
‘button
Kali
txthasil.Text = Val(txtbil1.Text) * Val(txtbil2.Text)
End Sub
Private Sub Command4_Click()
‘button
Bagi
txthasil.Text = Val(txtbil1.Text) / Val(txtbil2.Text)
End Sub
Private Sub Command5_Click()
‘button
Baru
txtbil1.Text = 0
txtbil2.Text = 0
txthasil.Text = 0
txtbil1.SetFocus
End Sub
Private Sub Command6_Click()
‘button
keluar
Unload Me
End
Sub
keren gan berhasil, tp postingannya cuman 3 ya gak ada pembelajaran yg lain?
ReplyDelete