Private Sub comCal_Click()
amount = Val(txtQty.Text)
If optE.Value = True Then
price = 55 * amount
AddList optE.Caption
ElseIf optA.Value = True Then
price = 50 * amount
AddList optA.Caption
ElseIf optL.Value = True Then
price = 50 * amount
AddList optL.Caption
ElseIf optM.Value = True Then
price = 50 * amount
AddList optM.Caption
ElseIf optC.Value = True Then
price = 55 * amount
AddList optC.Caption
ElseIf optG.Value = True Then
price = 50 * amount
AddList optG.Caption
End If
tprice = price
lblAmt.Caption = tprice
If price <> 0 Then
sumprice = price + sumprice
lblSubTotal.Caption = sumprice
End If
AddList1 lblAmt.Caption
If tprice <> 0 Then
sumdue = sumdue + 1
lblTotal.Caption = sumdue
End If
comClear.Visible = True
comCal.Visible = False
End Sub
-------------------------------------------------------------------------------------------------
Private Sub comClear_Click()
comClear.Visible = False
comCal.Visible = True
optE.Value = False
optA.Value = False
optL.Value = False
optM.Value = False
optC.Value = False
optG.Value = False
txtQty.Text = ""
lblAmt.Caption = ""
End Sub
--------------------------------------------------------------------------------------------------------
Private Sub comExit_Click()
a = MsgBox("you want to depart a program", [vbYesNo], "Exit")
If a = vbYes Then
Unload Me
End If
End Sub
----------------------------------------------------------------------------------------------------------
Private Sub comNewOrde_Click()
txtQty.Text = ""
lblAmt.Caption = ""
lblSubTotal.Caption = ""
lblTotal.Caption = ""
optE.Value = False
optA.Value = False
optL.Value = False
optM.Value = False
optC.Value = False
optG.Value = False
List1.Clear
List2.Clear
End Sub
----------------------------------------------------------------------------------------------------------
Private Sub comSummary_Click()
Dim i As Integer
Form3.lblListProduct.Caption = ""
For i = 0 To List1.ListCount
Form3.lblListProduct.Caption = Form3.lblListProduct.Caption & List1.List(i) & vbCrLf
Next i
Dim j As Integer
Form3.lblPriceProduct.Caption = ""
For j = 0 To List2.ListCount
Form3.lblPriceProduct.Caption = Form3.lblPriceProduct.Caption & List2.List(j) & vbCrLf
Next j
Form3.lblPricetotal.Caption = lblSubTotal.Caption
Form3.Show
End Sub
----------------------------------------------------------------------------------------------------------
Sub AddList(msg As String)
List1.AddItem msg
End Sub
------------------------------------------------------------------------------------------------------------
Sub AddList1(msg As String)
List2.AddItem msg
End Sub
-------------------------------------------------------------------------------------------------------
ไม่มีความคิดเห็น:
แสดงความคิดเห็น