基本信息
源码名称:VB随机 掷骰子示例源码
源码大小:1.94KB
文件格式:.rar
开发语言:ASP
更新时间:2013-10-24
友情提示:(无需注册或充值,赞助后即可获取资源下载链接)
嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):813200300
本次赞助数额为: 2 元×
微信扫码支付:2 元
×
请留下您的邮箱,我们将在2小时内将文件发到您的邮箱
源码介绍
VERSION 5.00 Begin VB.Form Form1 Caption = "掷骰子" ClientHeight = 3090 ClientLeft = 60 ClientTop = 345 ClientWidth = 5385 FillColor = &H00FFFFFF& LinkTopic = "Form1" LockControls = -1 'True ScaleHeight = 3090 ScaleWidth = 5385 StartUpPosition = 2 '屏幕中心 Begin VB.CommandButton Command2 Caption = "停 止" Height = 375 Left = 3120 TabIndex = 2 Top = 2280 Width = 1815 End Begin VB.CommandButton Command1 Caption = "开 始" Height = 375 Left = 3120 TabIndex = 1 Top = 1440 Width = 1815 End Begin VB.Shape Shape2 Height = 495 Index = 6 Left = 1920 Top = 1920 Width = 495 End Begin VB.Shape Shape2 Height = 495 Index = 4 Left = 1920 Top = 480 Width = 495 End Begin VB.Shape Shape2 Height = 495 Index = 5 Left = 1920 Top = 1200 Width = 495 End Begin VB.Shape Shape2 Height = 495 Index = 3 Left = 1200 Top = 1200 Width = 495 End Begin VB.Shape Shape2 Height = 495 Index = 2 Left = 480 Top = 1920 Width = 495 End Begin VB.Shape Shape2 Height = 495 Index = 1 Left = 480 Top = 1200 Width = 495 End Begin VB.Shape Shape2 Height = 495 Index = 0 Left = 480 Top = 480 Width = 495 End Begin VB.Label Label1 Caption = "Label1" BeginProperty Font Name = "宋体" Size = 21.75 Charset = 134 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 855 Left = 3000 TabIndex = 0 Top = 240 Width = 2175 End Begin VB.Shape Shape1 Height = 2415 Left = 240 Top = 240 Width = 2415 End End Attribute VB_Name = "Form1" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Private Sub Command1_Click() num = Int(Rnd * 6) 1 Label1.Caption = num & "点" DisPlay (num) End Sub Private Sub Command2_Click() End End Sub Private Sub Form_Load() For i = 0 To 6 Shape2(i).FillColor = &H0& Shape2(i).FillStyle = 0 Shape2(i).Shape = 3 Shape2(i).Visible = False Next i Shape1.FillColor = &HFFFFFF Shape1.FillStyle = 0 Shape1.Shape = 5 Randomize Timer Label1.Caption = "1 点" DisPlay (1) End Sub Sub DisPlay(a) For i = 0 To 6 Shape2(i).Visible = False Next i For i = 0 To 6 If i <> 2 Or i <> 4 Then Shape2(i).FillColor = &H0& End If Next i Select Case a Case 1 Shape2(3).FillColor = &H0& Shape2(3).Visible = True Case 2 Shape2(0).Visible = True Shape2(6).Visible = True Case 3 Shape2(0).Visible = True Shape2(3).Visible = True Shape2(6).Visible = True Case 4 For i = 0 To 6 If i = 0 Or i = 2 Or i = 4 Or i = 6 Then Shape2(i).Visible = True End If Next i Case 5 For i = 0 To 6 If i = 0 Or i = 2 Or i = 3 Or i = 4 Or i = 6 Then Shape2(i).Visible = True End If Next i Case 6 For i = 0 To 6 If i <> 3 Then Shape2(i).Visible = True End If Next i End Select End Sub