Hey all,
With VB6 and VB9, I continue to have problems displaying images on a form while playing wav files (either by API call or by My.Computer.Audio.Play method).
I set up a loop to display pictureboxes on a form (card images), with a wav sound file that is supposed to be played each time a picturebox is displayed. However the pictureboxes won't display until after the loop finishes and the sounds have been played several times in series:
Example code:
For I = 0 To 3
picBox(I).Visible = True ' picBox is an object collection of pictureboxes
My.Computer.Audio.Play(My.Resources.Deal, _
AudioPlayMode.WaitToComplete)
Next
The series of 4 Deal.wav sounds are heard, but the cards aren't displayed until afterwards.
How can I synchronize the sounds to the images? I'd like to show 1 picBox, have a sound, then show the next picBox and so on.
Any advice would be greatly appreciated. I had this problem with VB6 and had to do some extraneous steps to fix the problem. I can't solve the dilemma with VB9.
Thanks,
BK
With VB6 and VB9, I continue to have problems displaying images on a form while playing wav files (either by API call or by My.Computer.Audio.Play method).
I set up a loop to display pictureboxes on a form (card images), with a wav sound file that is supposed to be played each time a picturebox is displayed. However the pictureboxes won't display until after the loop finishes and the sounds have been played several times in series:
Example code:
For I = 0 To 3
picBox(I).Visible = True ' picBox is an object collection of pictureboxes
My.Computer.Audio.Play(My.Resources.Deal, _
AudioPlayMode.WaitToComplete)
Next
The series of 4 Deal.wav sounds are heard, but the cards aren't displayed until afterwards.
How can I synchronize the sounds to the images? I'd like to show 1 picBox, have a sound, then show the next picBox and so on.
Any advice would be greatly appreciated. I had this problem with VB6 and had to do some extraneous steps to fix the problem. I can't solve the dilemma with VB9.
Thanks,
BK