文件名称:vb扫雷程序
文件大小:585KB
文件格式:RAR
更新时间:2016-01-14 03:24:27
扫雷
扫雷: Public Class StartGame Private _Button As CustomButton Private _IsBusy As Boolean = True Public GameMode As Board.GameMode Public MaxPlayers As Integer Private Sub StartGame_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'Hook Button for custom drawing _Button = New CustomButton(PlayGame) Version.Text = Application.ProductVersion TraditionalGame.Checked = (GameMode = Board.GameMode.Classic) ModernGame.Checked = (GameMode = Board.GameMode.Modern) _IsBusy = False End Sub Private Sub Game_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TraditionalGame.CheckedChanged, ModernGame.CheckedChanged If _IsBusy Then Return If sender.Equals(TraditionalGame) Then GameMode = Board.GameMode.Classic Else GameMode = Board.GameMode.Modern End If End Sub Private Sub Player_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Humans.ValueChanged, Computers.ValueChanged If sender.Equals(Humans) Then TestPlayers(Humans, Computers) Else TestPlayers(Computers, Humans) End If End Sub Private Sub TestPlayers(ByVal Player1 As NumericUpDown, ByVal Player2 As NumericUpDown) ' Check How many Players Select Case Player1.Value Case Is > MaxPlayers ' Too many Player1.Value = MaxPlayers Case Is > MaxPlayers - Player2.Value ' Too Many Player2.Value = MaxPlayers - Player1.Value Case 1 ' Maybe not enough If Player2.Value = 0 Then Player2.Value = 1 End If Case 0 ' Maybe not enough If Player2.Value < 2 Then Player2.Value = 2 End If Case Is < 0 ' Invalid Player1.Value = 0 End Select End Sub Private Sub Speed_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles Speed.KeyPress ' Numeric and control character input only e.Handled = ((Not Char.IsDigit(e.KeyChar)) AndAlso (Not Char.IsControl(e.KeyChar))) End Sub End Class
【文件预览】:
庄健和吴鹏
----新建 Microsoft PowerPoint 演示文稿.ppt(530KB)
----Eatery()
--------MineSweeper()
--------MineSweeper.sln(929B)
--------MineSweeper.suo(51KB)