Senin, 28 Oktober 2013
TUTORIAL VB DENGAN IF SEDERHANA
INI KODE-KODE NYA BRO???
Private Sub Check1_Click()
If Check1.Value = 1 Then
biayakursus.Text = Val(biayakursus.Text) + 100000
Else
biayakursus.Text = Val(biayakursus.Text) - 100000
End If
End Sub
Private Sub Check2_Click()
If Check2.Value = 1 Then
biayakursus.Text = Val(biayakursus.Text) + 85000
Else
biayakursus.Text = Val(biayakursus.Text) - 85000
End If
End Sub
Private Sub Check3_Click()
If Check3.Value = 1 Then
biayakursus.Text = Val(biayakursus.Text) + 90000
Else
biayakursus.Text = Val(biayakursus.Text) - 90000
End If
End Sub
Private Sub Check4_Click()
If Check4.Value = 1 Then
biayakursus.Text = Val(biayakursus.Text) + 150000
Else
biayakursus.Text = Val(biayakursus.Text) - 150000
End If
End Sub
Private Sub Command1_Click()
Dim a As Single
Dim b As Single
Dim total As Double
a = biayakursus.Text
b = biayaadmin.Text
total = a + b
txt6.Text = total
End Sub
Private Sub Command2_Click()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
biayakursus.Text = ""
biayaadmin.Text = ""
txt6.Text = ""
Option1.Value = False
Option2.Value = False
Check1.Value = False
Check2.Value = False
Check3.Value = False
Check4.Value = False
Option3.Value = False
Option4.Value = False
Option5.Value = False
Option6.Value = False
Option7.Value = False
Option8.Value = False
End Sub
Private Sub Command3_Click()
Pesan = "Apakah Anda yakin ingin keluar ?"
P = MsgBox(Pesan, vbQuestion + vbYesNo, Me.Caption)
If P = vbYes Then
Cancel = 0
Unload Me
ElseIf P = vbNo Then
Cancel = 1
Text1.SetFocus
End If
End Sub
Private Sub Command4_Click()
Text1.Enabled = True
Text2.Enabled = True
Text3.Enabled = True
biayakursus.Enabled = True
biayaadmin.Enabled = True
txt6.Enabled = True
Option1.Enabled = True
Option2.Enabled = True
Option3.Enabled = True
Option4.Enabled = True
Option5.Enabled = True
Option6.Enabled = True
Option7.Enabled = True
Option8.Enabled = True
Check1.Enabled = True
Check2.Enabled = True
Check3.Enabled = True
Check4.Enabled = True
Command1.Enabled = True
Command2.Enabled = True
Command3.Enabled = True
Command4.Enabled = True
End Sub
Private Sub Form_Load()
Text1.Enabled = False
Text2.Enabled = False
Text3.Enabled = False
biayakursus.Enabled = False
biayaadmin.Enabled = False
txt6.Enabled = False
Option1.Enabled = False
Option2.Enabled = False
Option3.Enabled = False
Option4.Enabled = False
Option5.Enabled = False
Option6.Enabled = False
Option7.Enabled = False
Option8.Enabled = False
Check1.Enabled = False
Check2.Enabled = False
Check3.Enabled = False
Check4.Enabled = False
Command1.Enabled = False
Command2.Enabled = False
Command3.Enabled = False
End Sub
Private Sub Option6_Click()
If Option6.Value = True Then
biayaadmin.Text = 25000
End If
End Sub
Private Sub Option7_Click()
If Option7.Value = True Then
biayaadmin.Text = 30000
End If
End Sub
Private Sub Option8_Click()
If Option8.Value = True Then
biayaadmin.Text = 50000
End If
End Sub
Private Sub Text1_Click()
Text1.Text = "EDO JAYA PRANATA"
Text1.ForeColor = vbRed
Text1.BackColor = vbYellow
Text1.FontBold = True
Text1.Alignment = 2
End Sub
Private Sub Text2_Click()
Text2.Text = "21 JULI 1993"
Text2.ForeColor = vbBlue
Text2.BackColor = vbGreen
Text2.FontBold = True
Text2.Alignment = 2
End Sub
Private Sub Text3_Click()
Text3.Text = "DUSUN III SIDOARJO, KABUPATEN SIMALUNGAN, KEC.TANAH JAWA"
Text3.ForeColor = vbGreen
Text3.BackColor = vbRed
Text3.FontBold = True
Text3.Alignment = 2
End Sub
INI OUTPUT NYA BRO?????
JIKA KITA AKTIFKAN..... MAKA KITA TINGGAL MELAKUKAN PILIHAN UNTUK JENIS LES??? DAN DISINI NAMA, ALAMAT DAN TGL LAHIR SAYA BIKIN OTOMATIS LANGSUNG DI KLIK.....OK?
SELAMAT MENCOBA.............................!!!!!!!1
Langganan:
Postingan (Atom)