⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 form1.frm

📁 最重要的是自己要努力学习与探索呀
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form1 
   BackColor       =   &H00000000&
   Caption         =   "俄罗斯方块游戏"
   ClientHeight    =   6660
   ClientLeft      =   3210
   ClientTop       =   960
   ClientWidth     =   5175
   Icon            =   "Form1.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   Picture         =   "Form1.frx":08CA
   ScaleHeight     =   6660
   ScaleWidth      =   5175
   Begin VB.Timer Timer2 
      Interval        =   500
      Left            =   3960
      Top             =   4440
   End
   Begin VB.Timer Timer1 
      Left            =   4440
      Top             =   4440
   End
   Begin VB.Image snow 
      Height          =   375
      Index           =   0
      Left            =   4440
      Top             =   3720
      Width           =   375
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Private Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal lpstrReturnString As String, ByVal uReturnLength As Long, ByVal hwndCallback As Long) As Long
Dim IsMusicOn As Boolean
Dim RetValue As Long
Dim num As Integer
Dim dx(), dy(), xp(), yp(), am(), stx(), sty() As Double

Private Sub Form_Click()
    Form1.Hide
    frmmain.Show
End Sub

Private Sub Form_Load()
    IsMusicOn = True                                                 '背景音乐
    RetValue = mciSendString("OPEN " & App.Path & "\shilei1.mid TYPE SEQUENCER ALIAS BackgroundMusic", "", 0, 0)
End Sub
Private Sub Form_Unload(Cancel As Integer)
    IsMusicOn = False
    RetValue = mciSendString("CLOSE BackgroundMusic", "", 0, 0)   '关闭窗口后关闭音乐
End Sub
Private Sub Timer2_Timer()                     '音乐一遍结束后重新播放音乐
    Dim MCIStatusLen As Integer
    Dim MCIStatus As String
    If IsMusicOn = True Then
        MCIStatusLen = 15
        MCIStatus = String(MCIStatusLen + 1, " ")
        RetValue = mciSendString("STATUS BackgroundMusic MODE", MCIStatus, MCIStatusLen, 0)
        If UCase(Left$(MCIStatus, 7)) = "STOPPED" Then
            RetValue = mciSendString("PLAY BackgroundMusic FROM 0", "", 0, 0)
        End If
    End If
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -