Form2.frm
资源名称:七八个vb游戏.rar [点击查看]
上传用户:tashmp
上传日期:2010-04-03
资源大小:882k
文件大小:2k
源码类别:
其他游戏
开发平台:
Visual Basic
- VERSION 5.00
- Begin VB.Form Form2
- Caption = "游戏设置"
- ClientHeight = 1365
- ClientLeft = 60
- ClientTop = 345
- ClientWidth = 2595
- LinkTopic = "Form2"
- ScaleHeight = 1365
- ScaleWidth = 2595
- StartUpPosition = 3 'Windows Default
- Begin VB.CommandButton Command2
- Caption = "重设"
- Height = 375
- Left = 1320
- TabIndex = 3
- Top = 840
- Width = 855
- End
- Begin VB.CommandButton Command1
- Caption = "确定"
- Height = 375
- Left = 240
- TabIndex = 2
- Top = 840
- Width = 855
- End
- Begin VB.TextBox Text1
- Height = 375
- Left = 840
- TabIndex = 1
- Top = 240
- Width = 1095
- End
- Begin VB.Image Image1
- Height = 480
- Left = 2040
- Picture = "Form2.frx":0000
- Top = 240
- Width = 480
- End
- Begin VB.Label Label1
- Caption = "地雷个数"
- Height = 255
- Left = 0
- TabIndex = 0
- Top = 240
- Width = 735
- End
- End
- Attribute VB_Name = "Form2"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- '游戏设置确定
- Private Sub Command1_Click()
- If Val(Text1.Text) <= 16 And Text1.Text <> "" Then '地雷数要少于16个
- bobm_number = Val(Text1)
- Form2.Hide
- Call newGame
- Else
- MsgBox "地雷数太多(地雷数少于16个)!!", 48, "友情提示!"
- End If
- End Sub
- '重设地雷数
- Private Sub Command2_Click()
- Text1.Text = ""
- End Sub
- Private Sub Form_Load()
- Form2.Left = Form1.Left + Form1.Width + 10
- Form2.Top = Form1.Top
- End Sub
- '防止输入第一个数为0
- Private Sub Text1_Change()
- Dim s As String
- s = Text1
- If Left(s, 1) = "0" Then
- MsgBox "无效输入(第一个数不能为0)!", 48, "友情提示!"
- Text1.Text = ""
- End If
- End Sub
- '只让输入数字
- Private Sub Text1_KeyPress(KeyAscii As Integer)
- Dim s As String
- s = Trim(Text1.Text)
- 's = Left(s, 1)
- 'MsgBox s
- If KeyAscii >= 48 And KeyAscii <= 57 Then '只让输入数字
- Else
- KeyAscii = 0 '输入非数字无效
- End If
- 'If Left(s, 1) = "0" Then
- 'MsgBox "无效输入,请重新设置!", 48, "友情提示!"
- 'End If
- End Sub