廣告廣告
  加入我的最愛 設為首頁 風格修改
首頁 首尾
 手機版   訂閱   地圖  簡體 
您是第 1992 個閱讀者
 
發表文章 發表投票 回覆文章
  可列印版   加為IE收藏   收藏主題   上一主題 | 下一主題   
kkbb
數位造型
個人文章 個人相簿 個人日記 個人地圖
路人甲
級別: 路人甲 該用戶目前不上站
推文 x0 鮮花 x0
分享: 轉寄此文章 Facebook Plurk Twitter 複製連結到剪貼簿 轉換為繁體 轉換為簡體 載入圖片
推文 x0
[Basic][求助] (VB)救命呀!
我寫了一個簡單的VB飛行棋,但唔知點解每逢有"+"號的c ..

訪客只能看到部份內容,免費 加入會員 或由臉書 Google 可以看到全部內容



獻花 x0 回到頂端 [樓 主] From:香港網上行 | Posted:2007-05-26 21:40 |
overing 手機
個人文章 個人相簿 個人日記 個人地圖
初露鋒芒
級別: 初露鋒芒 該用戶目前不上站
推文 x0 鮮花 x55
分享: 轉寄此文章 Facebook Plurk Twitter 複製連結到剪貼簿 轉換為繁體 轉換為簡體 載入圖片

宣告請放最外面...
dim那些...
不然你每次按下cmdRoll就全部重設了...
這樣看得懂嗎?@@
還有麻煩下面重複那篇請刪除

複製程式
Dim intDice As Integer
Dim intStep(0 To 3) As Integer
Dim intSBack As Integer
Dim intRound As Integer

Private Sub cmdExit_Click()
'end the project
End
End Sub

Private Sub cmdRoll_Click()


'generate random value between 1 and 6
intDice = Int((6 * Rnd) + 1)
lblDice.Caption = intDice
intRound = intRound + 1
If intRound > 4 Then
intRound = 1
End If

If intRound = 1 Then
   intStep(0) = intStep(0) + intDice
     If intStep(0) = 15 Then
        Ch(0).Top = Sq(15).Top
        Ch(0).Left = Sq(15).Left
        MsgBox "The winner is" & vbCrLf & txtP1.Text, vbOKOnly, "Congratulation !!!"
     ElseIf intStep(0) > 15 Then
        intSBack = intStep(0) Mod 15
        intStep(0) = 15 Mod intSBack
        Ch(0).Top = Sq(intStep(0)).Top
        Ch(0).Left = Sq(intStep(0)).Left
     ElseIf intStep(0) < 15 Then
        Ch(0).Top = Sq(intStep(0)).Top
        Ch(0).Left = Sq(intStep(0)).Left
     End If
End If

If intRound = 2 Then
   intStep(1) = intStep(1) + intDice
     If intStep(1) = 15 Then
        Ch(1).Top = Sq(15).Top
        Ch(1).Left = Sq(15).Left
        MsgBox "The winner is" & vbCrLf & txtP2.Text, vbOKOnly, "Congratulation !!!"
     ElseIf intStep(1) > 15 Then
        intSBack = intStep(1) Mod 15
        intStep(1) = 15 Mod intSBack
        Ch(1).Top = Sq(intStep(1)).Top
        Ch(1).Left = Sq(intStep(1)).Left
     ElseIf intStep(1) < 15 Then
        Ch(1).Top = Sq(intStep(1)).Top
        Ch(1).Left = Sq(intStep(1)).Left
     End If
End If

If intRound = 3 Then
   intStep(2) = intStep(2) + intDice
     If intStep(2) = 15 Then
        Ch(2).Top = Sq(15).Top
        Ch(2).Left = Sq(15).Left
        MsgBox "The winner is" & vbCrLf & txtP1.Text, vbOKOnly, "Congratulation !!!"
     ElseIf intStep(2) > 15 Then
        intSBack = intStep(2) Mod 15
        intStep(2) = 15 Mod intSBack
        Ch(2).Top = Sq(intStep(2)).Top
        Ch(2).Left = Sq(intStep(2)).Left
     ElseIf intStep(2) < 15 Then
        Ch(2).Top = Sq(intStep(2)).Top
        Ch(2).Left = Sq(intStep(2)).Left
     End If
End If

If intRound = 4 Then
   intStep(3) = intStep(3) + intDice
     If intStep(3) = 15 Then
        Ch(3).Top = Sq(15).Top
        Ch(3).Left = Sq(15).Left
        MsgBox "The winner is" & vbCrLf & txtP1.Text, vbOKOnly, "Congratulation !!!"
     ElseIf intStep(3) > 15 Then
        intSBack = intStep(3) Mod 15
        intStep(3) = 15 Mod intSBack
        Ch(3).Top = Sq(intStep(3)).Top
        Ch(3).Left = Sq(intStep(3)).Left
     ElseIf intStep(0) < 15 Then
        Ch(3).Top = Sq(intStep(3)).Top
        Ch(3).Left = Sq(intStep(3)).Left
     End If
End If

End Sub


Zippy G2 600W
Intel C2Q Q9550
Gigabyte GA-X48-DQ6
Gigabyte GV-NX96T512H-B
G-skill pi 1100MHz 2Gx4
ACARD ANS-9010 32GB (Windows7 10sec boot!!)
WD 150GB(WD1500ADFD)/640GB(6400AASK)
獻花 x0 回到頂端 [1 樓] From:未知地址 | Posted:2007-05-27 00:59 |
phylli
數位造型
個人文章 個人相簿 個人日記 個人地圖
路人甲
級別: 路人甲 該用戶目前不上站
推文 x0 鮮花 x0
分享: 轉寄此文章 Facebook Plurk Twitter 複製連結到剪貼簿 轉換為繁體 轉換為簡體 載入圖片

down 5 島ge...? 表情


獻花 x0 回到頂端 [2 樓] From:香港和記電訊 | Posted:2007-05-28 17:27 |

首頁  發表文章 發表投票 回覆文章
Powered by PHPWind v1.3.6
Copyright © 2003-04 PHPWind
Processed in 0.016828 second(s),query:16 Gzip disabled
本站由 瀛睿律師事務所 擔任常年法律顧問 | 免責聲明 | 本網站已依台灣網站內容分級規定處理 | 連絡我們 | 訪客留言