Powered By Blogger

Jumat, 13 September 2013

Bagi yang doyan Visual Basic ataupun mau belajar, ini saya kasih satu script untuk membuat Struk Belanja I Hope U Guys Like It!


Dim Bayar As Single

Private Sub cmdBersih_Click()
txtjumlah.Text = ""
txtharga.Text = ""
lblHasil = ""
txtjumlah.SetFocus
End Sub

Private Sub cmdHitung_Click()
Bayar = Val(txtjumlah.Text) * Val(txtharga.Text)
lblHasil = Format (bayar, "Rp ###,###,###") & ",-"
Cmdbersih.Enabled = True
Cmdkeluar.Enabled = True
End Sub

Private Sub cmdkeluar_click()
psn = MsgBox ("Anda yakin akan Keluar", 32 + 4, "Informasi")
If psn = vbYes Then
MsgBox "Terima kasih", 32, "Informasi"
End
Else
If psn = vbNo Then
MsgBox "Lho... Kok Ga jadi", 32, "Informasi"
End If
End If
End Sub

Private Sub Form_Load()
Cmdhitung.Enabled = false
Cmdbersih.Enabled = false
Cmdkeluar.Enabled = false
End Sub

Private Sub txtharga_Change()
bayar = Val(txtjumlah.Text) * Val(txtharga.Text)
On error Resume next
lblhasil = Format (" Rp ") & ",-"
Exit Sub
End Sub

Private Sub txtharga_KeyPress (KeyAscii as integer)
If KeyAscii = 13 then
Cmdhitung.Enabled = True
CmdHitung.SetFocus
Else
If Not (KeyAscii >= Asc("0") And keyAscii <= Asc("9") Or KeyAscii = vbKeyBack) Then
MsgBox "Hanya Boleh Memasukan angka!", 16, "Informasi"
KeyAscii = 0
End If
End If
End Sub



=>>Raal_21<<=

Tidak ada komentar:

Posting Komentar