你发了2遍啊?我在复制一次。其实主要是思路问题。 那是因为你的声音加载是在图片加载之前,如果你把这两个的代码换一个位置,那就先出现图片、后出现声音了。 如果想同时出现声音和图片,可以设置2个标志,并且先将图片隐藏: dim soundStatus,pictureStatus as boolean if 声音加载 then soundStatus=true end if if 图片加载 then pictureStatus=true end if if soundStatus and pictureStatus then 图片.visible=true 声音.播放=true end if
参考下面: Option ExplicitPrivate Sub Command1_Click()
Picture1.Picture = LoadPicture '("c:\images.jpg") If Picture1.Picture = 0 Then MsgBox ("没有加裁图片!") Else MsgBox ("已经加裁了图片!") sndPlaySoundFromMemory wArr(0), SND_MEMORY End If
End Sub
Image1.Picture = LoadResPicture(100 + a, vbResBitmap) Image1.RefreshsndPlaySoundFromMemory wArr(0), SND_MEMORY 这样试试
那是因为你的声音加载是在图片加载之前,如果你把这两个的代码换一个位置,那就先出现图片、后出现声音了。 如果想同时出现声音和图片,可以设置2个标志,并且先将图片隐藏:
dim soundStatus,pictureStatus as boolean
if 声音加载 then
soundStatus=true
end if
if 图片加载 then
pictureStatus=true
end if
if soundStatus and pictureStatus then
图片.visible=true
声音.播放=true
end if
Option ExplicitPrivate Sub Command1_Click()
Picture1.Picture = LoadPicture '("c:\images.jpg")
If Picture1.Picture = 0 Then
MsgBox ("没有加裁图片!")
Else
MsgBox ("已经加裁了图片!")
sndPlaySoundFromMemory wArr(0), SND_MEMORY
End If
End Sub