www.pudn.com > 030404_russia.zip > Form1.frm


VERSION 5.00 
Object = "{51361672-661A-11D7-AF49-00E04C528B30}#1.0#0"; "TETRISBOX32.OCX" 
Begin VB.Form Form1  
   BorderStyle     =   1  'Fixed Single 
   Caption         =   "我的俄罗斯方块" 
   ClientHeight    =   7485 
   ClientLeft      =   45 
   ClientTop       =   330 
   ClientWidth     =   5985 
   KeyPreview      =   -1  'True 
   LinkTopic       =   "Form1" 
   MaxButton       =   0   'False 
   MinButton       =   0   'False 
   ScaleHeight     =   7485 
   ScaleWidth      =   5985 
   StartUpPosition =   3  '窗口缺省 
   Begin VB.PictureBox picNext  
      AutoSize        =   -1  'True 
      Height          =   1335 
      Left            =   3960 
      ScaleHeight     =   1275 
      ScaleWidth      =   1395 
      TabIndex        =   5 
      Top             =   1440 
      Width           =   1455 
   End 
   Begin VB.TextBox txtSpeed  
      Height          =   270 
      Left            =   3960 
      TabIndex        =   3 
      Text            =   "1000" 
      Top             =   840 
      Width           =   1455 
   End 
   Begin VB.CommandButton cmdPause  
      Caption         =   "暂 停" 
      Enabled         =   0   'False 
      Height          =   495 
      Left            =   4440 
      TabIndex        =   2 
      Top             =   6720 
      Width           =   1215 
   End 
   Begin VB.CommandButton cmdStart  
      Caption         =   "开 始" 
      Height          =   495 
      Left            =   4440 
      TabIndex        =   1 
      Top             =   6000 
      Width           =   1215 
   End 
   Begin TetrisBoxCtl.TetrisBox TetrisBox1  
      Height          =   6900 
      Left            =   360 
      TabIndex        =   0 
      Top             =   360 
      Width           =   3450 
      _ExtentX        =   6085 
      _ExtentY        =   12171 
      BackColor       =   16761024 
   End 
   Begin VB.Label lblCount  
      AutoSize        =   -1  'True 
      Caption         =   "0" 
      Height          =   180 
      Left            =   5040 
      TabIndex        =   9 
      Top             =   3120 
      Width           =   90 
   End 
   Begin VB.Label lblCountTip  
      AutoSize        =   -1  'True 
      Caption         =   "方块数:" 
      Height          =   180 
      Left            =   3960 
      TabIndex        =   8 
      Top             =   3120 
      Width           =   720 
   End 
   Begin VB.Label lblMarkTip  
      AutoSize        =   -1  'True 
      Caption         =   "您的成绩:" 
      Height          =   180 
      Left            =   3960 
      TabIndex        =   7 
      Top             =   3600 
      Width           =   900 
   End 
   Begin VB.Label lblMark  
      AutoSize        =   -1  'True 
      Caption         =   "0" 
      Height          =   180 
      Left            =   5040 
      TabIndex        =   6 
      Top             =   3600 
      Width           =   90 
   End 
   Begin VB.Label lblSpeedTip  
      AutoSize        =   -1  'True 
      Caption         =   "速度:" 
      Height          =   180 
      Left            =   3960 
      TabIndex        =   4 
      Top             =   600 
      Width           =   540 
   End 
End 
Attribute VB_Name = "Form1" 
Attribute VB_GlobalNameSpace = False 
Attribute VB_Creatable = False 
Attribute VB_PredeclaredId = True 
Attribute VB_Exposed = False 
 
Private Sub cmdPause_Click() 
    If TetrisBox1.Playing Then 
        TetrisBox1.PauseGame (True) 
        cmdPause.Caption = "继 续" 
    Else 
         TetrisBox1.PauseGame (False) 
        cmdPause.Caption = "暂 停" 
    End If 
End Sub 
 
Private Sub cmdStart_Click() 
    TetrisBox1.Speed = txtSpeed.Text 
    TetrisBox1.ClearBox 
    TetrisBox1.StartGame 
    txtSpeed.Enabled = False 
    cmdStart.Enabled = False 
    cmdPause.Enabled = True 
End Sub 
 
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) 
    Select Case KeyCode 
        Case vbKeyLeft 
            TetrisBox1.MoveLeft 
        Case vbKeyRight 
            TetrisBox1.MoveRight 
        Case vbKeyDown 
            TetrisBox1.MoveDown 
        Case vbKeyUp 
            TetrisBox1.Rotate 
    End Select 
End Sub 
Private Sub TetrisBox1_Lines(ByVal iNumberOfLines As Integer) 
    lblMark.Caption = Str(Val(lblMark.Caption) + iNumberOfLines) 
End Sub 
 
Private Sub TetrisBox1_NewPiece(ByVal iNextPieceType As Integer) 
    lblCount.Caption = Str(Val(lblCount.Caption) + 1) 
    Set picNext.Picture = TetrisBox1.PieceBitmap(iNextPieceType) 
End Sub