playsound.frm

来自「教你如何在VB中播放WAV文件,可以编译通过运行」· FRM 代码 · 共 51 行

FRM
51
字号
VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "Form1"
   ClientHeight    =   3195
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   4680
   LinkTopic       =   "Form1"
   ScaleHeight     =   3195
   ScaleWidth      =   4680
   StartUpPosition =   3  'Windows Default
   Begin VB.CommandButton Command1 
      Caption         =   "Command1"
      Height          =   735
      Left            =   480
      TabIndex        =   1
      Top             =   1680
      Width           =   3615
   End
   Begin VB.CommandButton Play_Sound 
      Caption         =   "Play Sound"
      Height          =   615
      Left            =   480
      TabIndex        =   0
      Top             =   720
      Width           =   3615
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private Declare Function PlaySound Lib "winmm.dll" Alias "PlaySoundA" (ByVal lpszName As String, ByVal hModule As Long, ByVal dwFlags As Long) As Long
Private Const SND_FILENAME = &H20000     '  name is a file name
Private Const SND_ASYNC = &H1         '  play asynchronously
Private Const SND_SYNC = &H0


Private Sub Command1_Click()
End
End Sub

Private Sub Play_Sound_Click()
PlaySound App.Path & "\Bigclap1.wav", 0, SND_SYNC
End Sub


⌨️ 快捷键说明

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