美文网首页
VB实现 扫雷

VB实现 扫雷

作者: mdbbm | 来源:发表于2016-10-12 22:41 被阅读135次

    想题目是什么想了半天 什么导弹炸弹 原来是扫雷啊

    Public Sub New(ByVal m As Integer, ByVal n As Integer) MineMatrix = New clsMineMatrix(m, n, 10) Buttons = New List(Of Button) Me.M = m : Me.N = n For i = 0 To m - 1 For j = 0 To n - 1 Dim ButtonX As Button = New Button With ButtonX .Location = New System.Drawing.Point(MarginX + w * j, MarginY + i * w) .Name = "Button " & i & " " & j 'Button 2 3 .Size = New System.Drawing.Size(w, w) .Text = "" .UseVisualStyleBackColor = True AddHandler ButtonX.Click, AddressOf ButtonX_Click End With Buttons.Add(ButtonX) Next Next End Sub Private Sub ButtonX_Click(ByVal sender As Object, ByVal e As EventArgs) Dim ij() As String = sender.name.split(" ") Dim i As Integer = ij(1), j As Integer = ij(2) MsgBox(i & "," & j) End Sub

    要添加的功能:

    • 点击显示 周围八个数字或是雷
    • 点击 到雷 游戏结束 显示全部
    • 把位置在右边的编辑框中显示出来

    相关文章

      网友评论

          本文标题:VB实现 扫雷

          本文链接:https://www.haomeiwen.com/subject/ocevyttx.html