24h購物| | PChome| 登入
2005-01-26 16:55:36| 人氣69| 回應0 | 上一篇 | 下一篇

ㄊ會考這ㄍㄇ??

推薦 0 收藏 0 轉貼0 訂閱站台

=  =這題有點複雜
怕考試時。。因緊張而漏東漏西

Dim fname(10) As String
Dim price(10) As Integer
Dim s, money As Integer

Private Sub Com1_Click()

Timer1.Enabled = True
Lst2.AddItem Lst1.Text
Lst1.RemoveItem Lst1.ListIndex
Lbl1.Caption = "累計金額:"
money = money + s
Lbl2.Caption = money
End Sub


Private Sub Com2_Click()

Lst1.AddItem Lst2.Text
Lst2.RemoveItem Lst2.ListIndex
Lbl1.Caption = "累計金額:"
money = money - s
Lbl2.Caption = money
End Sub


Private Sub Form_Load()

fname(0) = "小藍莓": fname(1) = "心形梨": fname(2) = "加州櫻桃"
fname(3) = "西瓜": fname(4) = "柿子": fname(5) = "香瓜"
fname(6) = "香蕉": fname(7) = "紫葡萄": fname(8) = "草莓"
fname(9) = "蕃茄": fname(10) = "蘋果"
price(0) = 10: price(1) = 11: price(2) = 22: price(3) = 33
price(4) = 44: price(5) = 55: price(6) = 66: price(7) = 77
price(8) = 8: price(9) = 9: price(10) = 10

Lst1.FontSize = 14
For i = 0 To 10
Lst1.AddItem fname(i)
Next i
End Sub


Private Sub Lst1_Click()

Pic1.Picture = LoadPicture("D:fruit" + Lst1.Text + ".wmf")
Pic1.Left = 2160
Pic1.Visible = True

For i = 0 To 10
If fname(i) = Lst1.Text Then
Lbl1.Caption = "單價:"
Lbl2.Caption = price(i)
s = price(i)
End If
Next i
End Sub

Private Sub Lst2_Click()

For i = 0 To 10
If fname(i) = Lst2.Text Then
Lbl1.Caption = "單價:"
Lbl2.Caption = price(i)
s = price(i)
End If
Next i
End Sub

Private Sub Timer1_Timer()
If Pic1.Left < 4320 Then
Pic1.Left = Pic1.Left + 100
Else
Pic1.Visible = False
Timer1.Enabled = False
End If
End Sub

台長: 酷仔♫° 瘋 
人氣(69) | 回應(0)| 推薦 (0)| 收藏 (0)| 轉寄
全站分類: 工作甘苦(工作心得、創業、求職)

是 (若未登入"個人新聞台帳號"則看不到回覆唷!)
* 請輸入識別碼:
請輸入圖片中算式的結果(可能為0) 
(有*為必填)
TOP
詳全文