haloo teman-teman saya pengen sampaikan sedikit ilmu tentang visual basic
awal nya saya susah banget belajar visual basic,tapi saya penasaran gi mana sih
belajar visual basic,masa orang bisa kita gak bisa,lama2 saya berfikir sampai rumah
kalau saya kaya gini terus saya gak bisa maju,saya belajar suguh-suguh tanya sama teman-teman
saya tidak malu belajar sama teman,akhir nya saya bisa juga,teryata belajar visual basic itu asik banget lo
apa lagi kalau kita pengen bertindak sesuatu,saya pengen jadi seseorang programer yang handal cukup samapi sini nya penjelas san nya,




Private Sub Command4_Click()
Text3.Text = Val(Text1.Text) + Val(Text2.Text)
If Val(Text3.Text) > 20000 Then
    Text4.Text = "0.1"
ElseIf Val(Text3.Text) > 20000 Then
    Text4.Text = "0.1"
ElseIf Val(Text3.Text) > 20000 Then
    Text4.Text = "0.1"
ElseIf Val(Text3.Text) > 20000 Then
    Text4.Text = "0.1"
ElseIf Val(Text3.Text) > 20000 Then
    Text4.Text = "0.1"
ElseIf Val(Text3.Text) > 25000 Then
    Text4.Text = "0.1"
End If

Text5.Text = Val(Text3.Text) - Val(Text4.Text)
End Sub

Private Sub Form_Load()
Combo1.AddItem "ayam peyet"
Combo1.AddItem "nasi goreng"
Combo1.AddItem "bakso"
Combo1.AddItem "fried chiken"
Combo1.AddItem "nasi uduk"
Combo1.AddItem "soto ayam"

Combo2.AddItem "jus apokat"
Combo2.AddItem "jus pinang"
Combo2.AddItem "jus jeruk"
Combo2.AddItem "es teler"
Combo2.AddItem "teh es"
Combo2.AddItem "kopi panas"
End Sub

Private Sub Text1_Change()
If Combo1.ListIndex = 0 Then
Text1.Text = 13000
ElseIf Combo1.ListIndex = 1 Then
Text1.Text = 12000
ElseIf Combo1.ListIndex = 2 Then
Text1.Text = 9000
ElseIf Combo1.ListIndex = 3 Then
Text1.Text = 14000
ElseIf Combo1.ListIndex = 4 Then
Text1.Text = 8000
ElseIf Combo1.ListIndex = 5 Then
Text1.Text = 11000
End If

End Sub

Private Sub Text2_Change()
If Combo2.ListIndex = 0 Then
Text2.Text = 8000
ElseIf Combo2.ListIndex = 1 Then
Text2.Text = 8000
ElseIf Combo2.ListIndex = 2 Then
Text2.Text = 7000
ElseIf Combo2.ListIndex = 3 Then
Text2.Text = 6000
ElseIf Combo2.ListIndex = 4 Then
Text2.Text = 5000
ElseIf Combo2.ListIndex = 5 Then
Text2.Text = 3000
End If
End Sub


Private Sub total_harga()
total_harga = Val(Text3.Text) + Val(Text4.Text)
Text5 = total_harga
End Sub

Private Sub Text4_Change()
If Val(Text3.Text) > 20000 Then
    Text4.Text = "0.1"
ElseIf Val(Text3.Text) > 20000 Then
    Text4.Text = "0.1"
ElseIf Val(Text3.Text) > 20000 Then
    Text4.Text = "0.1"
ElseIf Val(Text3.Text) > 20000 Then
    Text4.Text = "0.1"
ElseIf Val(Text3.Text) > 20000 Then
    Text4.Text = "0.1"
ElseIf Val(Text3.Text) > 25000 Then
    Text4.Text = "0.1"
End If
End Sub

Private Sub Text5_Change()
Text5.Text = Val(Text3.Text) - Val(Text4.Text)
End Sub

0 komentar: