Advertisement
Tony041010

購物系統(Form 1)

Jul 7th, 2021
421
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Public 衣服號碼 As Integer '第四題會用到
  2.  
  3. Private Sub Command1_Click(Index As Integer)
  4.     List1.AddItem Label1(Index) & vbTab & Combo1(Index) & "*" & Combo2(Index) & vbTab & Label4(Index) * Combo2(Index)
  5.     List2.AddItem Combo2(Index) * Label4(Index)
  6.     Label5 = Label5 + Combo2(Index) * Label4(Index)
  7. End Sub
  8.  
  9. '1.初始化與訂購2.取消訂購3.限時打折4.大圖
  10. '第一題
  11. Private Sub Form_Load()
  12.     For i = 0 To 2
  13.         Combo1(i).Clear
  14.         Combo1(i).AddItem "L"
  15.         Combo1(i).AddItem "M"
  16.         Combo1(i).AddItem "S"
  17.         Combo2(i).Clear
  18.         Combo1(i).ListIndex = 0
  19.         For j = 0 To 20
  20.             Combo2(i).AddItem j
  21.         Next
  22.         Combo2(i).ListIndex = 0
  23.     Next
  24. End Sub
  25.  
  26.  
  27. '第二題
  28. Private Sub List1_DblClick() 'double click
  29.    a = List1.ListIndex
  30.     Label5 = Label5 - List2.List(a)
  31.     List1.RemoveItem a
  32.     List2.RemoveItem a
  33.    
  34. End Sub
  35. '第三題
  36. Private Sub Label5_Change()
  37. 'Get Time : Hour(Now)
  38.    If Val(Hour(Now)) >= Text1 And Val(Hour(Now)) <= Text2 Then
  39.         Label8 = Label5 / 2
  40.     Else
  41.         If Label5 >= 5000 Then
  42.             Label8 = Label5 * 0.9
  43.         Else
  44.             If Label5 >= 3000 Then
  45.                 Label8 = Label5 * 0.95
  46.             Else
  47.                 If Label5 >= 1000 Then
  48.                 Label8 = Label5
  49.                 Else
  50.                     Label8 = Label5 + 60
  51.                 End If
  52.             End If
  53.         End If
  54.    
  55.     End If
  56. End Sub
  57. '第四題
  58. Private Sub Image1_Click(Index As Integer)
  59.     衣服號碼 = Index
  60.     Form2.Show
  61. End Sub
  62.  
  63.  
Advertisement
RAW Paste Data Copied
Advertisement