[VB.NET]窗体资源释放问题

VB.NET源码-156个实用实例哦…… <script type="text/javascript"> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
窗体资源释放问题
我在一个非系统启动窗体上用以下代码播放一段背景音乐,为什么我关闭该窗体后,背景音乐还不消失?请问怎么把音乐也去掉。
Private Sub frmHomePage_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim SoundInst As New SoundClass
SoundInst.PlaySoundFile( c:/平湖秋月.wav )
SoundInst.PlaySoundFile( )
End Sub

Public Class SoundClass
Declare Auto Function PlaySound Lib winmm.dll (ByVal name _
As String, ByVal hmod As Integer, ByVal flags As Integer) As Integer
name specifies the sound file when the SND_FILENAME flag is set.
hmod specifies an executable file handle.
hmod must be Nothing if the SND_RESOURCE flag is not set.
flags specifies which flags are set.

The PlaySound documentation lists all valid flags.
Public Const SND_SYNC = &H0 play synchronously
Public Const SND_ASYNC = &H1 play asynchronously
Public Const SND_FILENAME = &H20000 name is file name
Public Const SND_RESOURCE = &H40004 name is resource name or atom

Public Sub PlaySoundFile(ByVal filename As String)
Plays a sound from filename.
PlaySound(filename, Nothing, SND_FILENAME Or SND_ASYNC)
End Sub
End Class
__________________________________________________________________________
音乐没有关
__________________________________________________________________________
怎么关掉啊?(注:代码中SoundInst.PlaySoundFile( )是多余的,不好意思。)
__________________________________________________________________________
SND_SYNC
__________________________________________________________________________
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值