Adsense

Blog-eWong Purbalingga

Kumpulan Info Menarik | Tutorial | Music | Tips | Pengetahuan Umum | Top Artikel, d.l.l

 


Rabu, 08 Mei 2013

Cara Membaut Program Operator Pada Visual Basic 6.0

  1. Siapkan Komponen Sbb :






















Masukan Coding Berikut :
Private Sub Combo1_Click()
If Combo1.Text = "Madu Hutan" Then
Text2 = 35000
ElseIf Combo1.Text = "Sosro" Then
Text2 = 2000
ElseIf Combo1.Text = "Tebs" Then
Text2 = 2500
ElseIf Combo1.Text = "Fruitea" Then
Text2 = 2500
ElseIf Combo1.Text = "Kue The Best" Then
Text2 = 2500
ElseIf Combo1.Text = "Kue Alma" Then
Text2 = 2000
ElseIf Combo1.Text = "Okky Jelly" Then
Text2 = 1000
ElseIf Combo1.Text = "Ale-ale" Then
Text2 = 1000
Else
Text2 = 500
End If
End Sub

Private Sub Command1_Click()
X = MsgBox("Yakin Ingin Keluar ?", vbQuestion + vbYesNo, "konfirmasi")
If X = vbYes Then
Unload Me
End If
End Sub

Private Sub Command2_Click()
If Command2.Caption = "Tambah" Then
Command2.Caption = "batal"
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Else
Command2.Caption = "Tambah"
End If
End Sub

Private Sub Form_Load()
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text8.Text = ""
Combo1.Text = ""
Combo1.AddItem "Madu Hutan"
Combo1.AddItem "Sosro"
Combo1.AddItem "Tebs"
Combo1.AddItem "Fruitea"
Combo1.AddItem "Kue The Best"
Combo1.AddItem "Kue Alma"
Combo1.AddItem "Okky Jelly "
Combo1.AddItem "Ale-ale"
Combo1.AddItem "Kacang"
End Sub

Private Sub Label1_Click()
Label1.ForeColor = vbBlue
End Sub

Private Sub Text3_Change()
Text4 = Val(Text2.Text) * Val(Text3.Text)
End Sub

Private Sub Text4_Change()
Text7 = Val(Text7) + Val(Text4) + Val(Text8)
End Sub

Private Sub Text5_Change()
Text6 = Val(Text5.Text) - Val(Text7.Text)
End Sub


Tampilan Output Saat Di Start :
























Selamat Mencoba..

0 komentar:

Posting Komentar

Sukses Bukan Milik Orang-orang pemalas
Tetapi orang-orang yang mau berusaha mempelajarinya.