Image1.Picture = LoadResPicture(100 + a, vbResBitmap) sndPlaySoundFromMemory wArr(0), SND_MEMORY为什么先播放wave ,后显示图片呢,怎么能先显示图片,再播放声音呢,我想不通,能有人帮我解释一下吗?

解决方案 »

  1.   

    你发了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
      

  2.   

    参考下面:
    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
      

  3.   

    Image1.Picture = LoadResPicture(100 + a, vbResBitmap) Image1.RefreshsndPlaySoundFromMemory wArr(0), SND_MEMORY 这样试试