Friday, May 20, 2011

Pemrograman visual basic (penjualan makanan & minuman sederhana)

::membuat program menu makanan dan minuman pada sebuah wifi::

Desain formnya seperti berikut:
Gampangji to!.......succes…………………

Desain tersebut berisikan label1-8/text1-6 serta 2 checkbox

Lalu masukkan kode seperti berikut:



Private Sub Check1_Click()

If Check1.Value = 1 Then

Text2.Text = Text2.Text + 8000

Else: Text2.Text = Text2.Text - 8000

End If

End Sub



Private Sub Check2_Click()

If Check2.Value = 1 Then

Text2.Text = Text2.Text + 8500

Else: Text2.Text = Text2.Text - 8500

End If

End Sub



Private Sub Check3_Click()

If Check3.Value = 1 Then

Text2.Text = Text2.Text + 6000

Else: Text2.Text = Text2.Text - 6000

End If

End Sub



Private Sub Check4_Click()

If Check4.Value = 1 Then

Text2.Text = Text2.Text + 9000

Else: Text2.Text = Text2.Text - 9000

End If

End Sub



Private Sub Check5_Click()

If Check5.Value = 1 Then

Text2.Text = Text2.Text + 7500

Else: Text2.Text = Text2.Text - 7500

End If

End Sub



Private Sub Check6_Click()

If Check6.Value = 1 Then

Text2.Text = Text2.Text + 8500

Else: Text2.Text = Text2.Text - 8500

End If

End Sub



Private Sub Check7_Click()

If Check7.Value = 1 Then

Text2.Text = Text2.Text + 6000

Else: Text2.Text = Text2.Text - 6000

End If

End Sub



Private Sub Command1_Click()

Dim Ket As String

Do

Form1.Left = Trim(Str(Int(Form1.Left) - 1))

Loop Until Form1.Left < -Form1.Width

Unload Me

End Sub



Private Sub Form_Activate()

Move (Screen.Width - Width) / 2, (Screen.Height - Height) / 2

Text2.Locked = True

Text5.Locked = True

End Sub



Private Sub Text3_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

If Text6.Text = "0" Then

Text6.Text = Text3.Text * Text2.Text

Else: Text6.Text = Text6.Text + Text3.Text * Text2.Text

End If

Text3.Text = ""

End If

End Sub



Private Sub Text4_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

Text5.Text = Text4.Text - Text6.Text

End If

End Sub

Private Sub Text6_Change()

'If Text6.Text = "" Then

'Text6.Text = Text3.Text * Text2.Text

'Else: Text6.Text = Text3.Text * Text2.Text + Text3.Text * Text2.Text

'End If

End Sub,

dan program setelah dijalankan

No comments:

Post a Comment

Download @ctive Boot Untuk memperbaiki windows tanpa install

Pernahkah anda mengalami kesulitan menginstall windows karena PC atau laptop anda mengalami kerusakan CD atau DVD-ROM? Pernahkah anda mengal...