belajar visual basic

PROGRAM VISUAL BASIC

Menghitung program buat pembelian makanan dan minuman di café strawberry.
Berikut rumus hitung:untuk kesalahan mohon di maklumiok.

TAMPILAN UTAMA:

RUMUS PROGRAM:

Private Sub Check1_Click()
Text3.Text = “50000”
End Sub

Private Sub Check2_Click()
Text4.Text = “40000”
End Sub

Private Sub Check3_Click()
Text5.Text = “6000”
End Sub

Private Sub Check4_Click()
Text13.Text = “20000”
End Sub

Private Sub Check5_Click()
Text14.Text = “40000”
End Sub

Private Sub Command1_Click()
Text23.Text = Val(Text24.Text) – Val(Text22.Text)
End Sub

Private Sub Command2_Click()
Text1.Text = “”
Text2.Text = “”
Text3.Text = “”
Text4.Text = “”
Text5.Text = “”
Text6.Text = “”
Text7.Text = “”
Text8.Text = “”
Text9.Text = “”
Text10.Text = “”
Text11.Text = “”
Text12.Text = “”
Text13.Text = “”
Text14.Text = “”
Text15.Text = “”
Text16.Text = “”
Text17.Text = “”
Text18.Text = “”
Text19.Text = “”
Text20.Text = “”
Text21.Text = “”
Text22.Text = “”
Text23.Text = “”
Text24.Text = “”
Check1.Enabled = False
Check2.Enabled = False
Check3.Enabled = False
Check4.Enabled = False
Check5.Enabled = False
Combo1.Enabled = False
Combo2.Enabled = False
Combo3.Enabled = False
End Sub

Private Sub Command3_Click()
eky = MsgBox(“apakah anda yakin akan keluar???”, vbYesNo + 32, “keluar”)
If eky = vbYes Then
Unload Me
End If
End Sub
Private Sub Form_Activate()
a = 1
For a = 1 To 31
Combo1.AddItem a
Next a
b = 1
For b = 1 To 12
Combo2.AddItem b
Next b
c = 1
For c = 1990 To 2100
Combo3.AddItem c
Next c
End Sub

Private Sub Text11_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text12.Text = Val(Text9.Text) + Val(Text10.Text) + Val(Text11.Text)
End If
End Sub

Private Sub Text15_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text17.Text = Val(Text13.Text) * Val(Text15.Text)
End If
End Sub

Private Sub Text16_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text18.Text = Val(Text14.Text) * Val(Text16.Text)
End If
End Sub

Private Sub Text18_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text19.Text = Val(Text17.Text) + Val(Text18.Text)
End If
End Sub

Private Sub Text19_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text20.Text = Val(Text12.Text) + Val(Text19.Text)
End If
End Sub

Private Sub Text20_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text17.Text = Val(Text13.Text) * Val(Text15.Text)
Text21.Text = 0.1 * Val(Text20.Text)
End If
End Sub

Private Sub Text21_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text22.Text = Val(Text20.Text) – Val(Text21.Text)
End If
End Sub

Private Sub Text24_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text23.Text = Val(Text24.Text) – Val(Text22.Text)
End If
End Sub

Private Sub Text6_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text9.Text = Val(Text3.Text) * Val(Text6.Text)
End If
End Sub

Private Sub Text7_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text10.Text = Val(Text4.Text) * Val(Text7.Text)
End If
End Sub

Private Sub Text8_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text11.Text = Val(Text5.Text) * Val(Text8.Text)
End If
End Sub

TAMPILAN HASIL PERHITUNGAN:

Itu hasil dari semua perhitungan dengan menjumlahkan data yang sudah di input dan hitung.

Berikut tampiln setelah di bersihkan dan pada saat akan keluar dari program form.buat yang lebih mengerti bsa membantu sya.terima kasih ya.

TAMPILAN BERSIH DAN TAMPILAN PADA SAAT AKAN KELUAR.

BERSIH:

TAMPILAN KELUAR:

WALAU TERLIHAT MUDAH,,TPI YA SEDIKIT2 AJA LAH BELAJARNYA.HEHEHEHE.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s