VENDING MACHINE VB 6.0 GUI AND CODE - iJayaprakash

VENDING MACHINE VB 6.0 GUI AND CODE

VENDING MACHINE VB 6.0 GUI AND CODE 




form 1

Dim J As Integer
Dim o As Integer
Dim s As Integer
Dim h As Integer

Private Sub cmddispence_Click()
cmdprint.Enabled = True
j = Val(txtsnack1.Text)
o = Val(txtsnack2.Text)
s = Val(txtsnack3.Text)
h = Val(txtsnack4.Text)


If (j <> 0) And Form2.lblitem1.Caption = "" Then
  Form2.lblitem1.Caption = "snack1"
  Form2.lblqty1.Caption = j
  Form2.lblprice1.Caption = "50"
  Form2.lbltotal1.Caption = 50 * j
  
 End If
If (o <> 0) And Form2.lblitem2.Caption = "" Then
  Form2.lblitem2.Caption = "snack2"
  Form2.lblqty2.Caption = o
  Form2.lblprice2.Caption = "45"
  Form2.lbltotal2.Caption = 45 * o
  
  End If
  
If (s <> 0) And Form2.lblitem3.Caption = "" Then
  Form2.lblitem3.Caption = "snack3"
  Form2.lblqty3.Caption = s
  Form2.lblprice3.Caption = "60"
  Form2.lbltotal3.Caption = 60 * s
  
  End If
  
If (h <> 0) And Form2.lblitem4.Caption = "" Then
  Form2.lblitem4.Caption = "snack4"
  Form2.lblqty4.Caption = h
  Form2.lblprice4.Caption = "70"
  Form2.lbltotal4.Caption = 70 * h
  
End If

Form2.lblbillamount.Caption = "Bill Amount: " & Val(Form2.lbltotal1.Caption) + Val(Form2.lbltotal2.Caption) + Val(Form2.lbltotal3.Caption) + Val(Form2.lbltotal4.Caption)
End Sub


Private Sub cmdprint_Click()
Unload Me
Form2.Show
End Sub
Private Sub Form_Load()
txtdsnack1.Text = ""
txtdsnack2.Text = ""
txtdsnack3.Text = ""
txtdsnack4.Text = ""
cmdprintbill.Enabled = False
End Sub



form 2

Private Sub cmdback_Click()
Unload Me
Form1.Show
End Sub

Private Sub Form_Load()
lbldate.Caption = "Date: " & Format(Date, "dd-mmm-yyyy")
End Sub

No comments:

Post a Comment

Translate