扫雷小游戏vb设计程序

全部设计过程
2025-01-02 09:08:44
推荐回答(3个)
回答1:

Public nn As Long
Public n As Long
Public x, y As Long
Private Sub Form_Load()
nn = 0
n = 1
''Picture1(i).Picture = "图片地址"
Picture1(i).Width = 300
Picture1(i).Height = 300
Timer1.Interval = 100
Timer1.Enabled = True
Label1.Caption = 0
Picture1(0).Visible = False
End Sub
Private Sub Picture1_Click(Index As Integer)
nn = nn + 1
Unload Picture1(Index)
Label1.Caption = nn
End Sub
Private Sub Timer1_Timer()
Randomize
x = Int((Form1.Width - 300 + 1) * Rnd + 300)
y = Int((Form1.Height - 1800 + 1) * Rnd + 1000)
Load Picture1(n)
Picture1(n).Left = x
Picture1(n).Top = y
Picture1(n).Visible = True
n = n + 1
if nn>=200 then
timer1.enable=false
''执行语句
end if
End Sub
打窗口上随机出现的砖块游戏

回答2:

用shell函数引用本机自带的扫雷游戏啊

回答3:

使用windows自带扫雷即可,使用vb很麻烦的。