广告广告
  加入我的最爱 设为首页 风格修改
首页 首尾
 手机版   订阅   地图  繁体 
您是第 1993 个阅读者
 
发表文章 发表投票 回覆文章
  可列印版   加为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.011844 second(s),query:16 Gzip disabled
本站由 瀛睿律师事务所 担任常年法律顾问 | 免责声明 | 本网站已依台湾网站内容分级规定处理 | 连络我们 | 访客留言