www.pudn.com > Winmine.rar > Form2.frm


VERSION 5.00 
Begin VB.Form Form2  
   BorderStyle     =   1  'Fixed Single 
   Caption         =   "自定义雷区" 
   ClientHeight    =   1680 
   ClientLeft      =   45 
   ClientTop       =   330 
   ClientWidth     =   3885 
   LinkTopic       =   "Form2" 
   MaxButton       =   0   'False 
   MinButton       =   0   'False 
   ScaleHeight     =   1680 
   ScaleWidth      =   3885 
   StartUpPosition =   2  'CenterScreen 
   Begin VB.CommandButton Command2  
      Caption         =   "取消" 
      Height          =   375 
      Left            =   2520 
      TabIndex        =   7 
      Top             =   720 
      Width           =   1095 
   End 
   Begin VB.CommandButton Command1  
      Caption         =   "确定" 
      Default         =   -1  'True 
      Height          =   375 
      Left            =   2520 
      TabIndex        =   6 
      Top             =   240 
      Width           =   1095 
   End 
   Begin VB.TextBox Text1  
      Height          =   270 
      Index           =   2 
      Left            =   1200 
      TabIndex        =   5 
      Text            =   "10" 
      Top             =   1200 
      Width           =   975 
   End 
   Begin VB.TextBox Text1  
      Height          =   270 
      Index           =   1 
      Left            =   1200 
      TabIndex        =   4 
      Text            =   "9" 
      Top             =   720 
      Width           =   975 
   End 
   Begin VB.TextBox Text1  
      Height          =   270 
      Index           =   0 
      Left            =   1200 
      TabIndex        =   3 
      Text            =   "9" 
      Top             =   225 
      Width           =   975 
   End 
   Begin VB.Label Label1  
      Caption         =   "雷数(&M):" 
      Height          =   255 
      Index           =   2 
      Left            =   240 
      TabIndex        =   2 
      Top             =   1200 
      Width           =   975 
   End 
   Begin VB.Label Label1  
      Caption         =   "宽度(&W):" 
      Height          =   255 
      Index           =   1 
      Left            =   240 
      TabIndex        =   1 
      Top             =   720 
      Width           =   975 
   End 
   Begin VB.Label Label1  
      Caption         =   "高度(&H):" 
      Height          =   255 
      Index           =   0 
      Left            =   240 
      TabIndex        =   0 
      Top             =   240 
      Width           =   975 
   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() 
Dim i, j, k 
i = Val(Text1(0).Text) 
j = Val(Text1(1).Text) 
k = Val(Text1(2).Text) 
If i < 9 Then i = 9 
'If i > 24 Then i = 24 
If j < 9 Then j = 9 
'If j > 30 Then j = 30 
If k < 10 Then k = 10 
If k > i * j Then k = i * j - 7 
zdyYn = i 
zdyXn = j 
zdyLs = k 
Call SetIniN("扫雷", "Width", j) 
Call SetIniN("扫雷", "Height", i) 
Call SetIniN("扫雷", "Mines", k) 
Unload Me 
End Sub 
 
Private Sub Command2_Click() 
Unload Me 
End Sub 
 
Private Sub Form_Load() 
Me.Icon = Form1.Icon 
Text1(0).Text = zdyYn 
Text1(1).Text = zdyXn 
Text1(2).Text = zdyLs 
End Sub 
 
Private Sub Text1_KeyPress(Index As Integer, KeyAscii As Integer) 
Dim i 
i = Chr(KeyAscii) 
If i < "0" Or i > "9" Then 
    KeyAscii = 0 
    Exit Sub 
End If 
End Sub