开发工具:
文件大小: 585kb
下载次数: 0
上传时间: 2012-12-24
详细说明: 扫雷: 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 = Bo ard.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 ...展开收缩
(系统自动生成,下载前可以参看下载内容)
下载文件列表
相关说明
- 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
- 本站是交换下载平台,提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度。
- 本站已设置防盗链,请勿用迅雷、QQ旋风等多线程下载软件下载资源,下载后用WinRAR最新版进行解压.
- 如果您发现内容无法下载,请稍后再次尝试;或者到消费记录里找到下载记录反馈给我们.
- 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
- 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.