469,928 Members | 1,861 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,928 developers. It's quick & easy.

Need playsound to wait for picturebox to become visible

I am a novice writing a simple program in Visual C++ Express and am
having an issue. I basically have several picture boxes of the same
size on top of each other with only one visible at a time. I have a
button that when clicked triggers an event that makes each picturebox
visible one at a time and plays a wav file associated with the image
in the picturebox. I have put an example of the code below:

//picturebox1 is already visible on the screen
PlaySound("c:\\picturebox1wave.wav",0,SND_SYNC|SND _FILENAME);
this->picturebox1->visible = false;
this->picturebox2->visible = true;
PlaySound("c:\\picturebox2wave.wav",0,SND_SYNC|SND _FILENAME);
this->picturebox2->visible = false;
this->picturebox3->visible = true;
PlaySound("c:\\picturebox3wave.wav",0,SND_SYNC|SND _FILENAME);
and so on......

The issue I have is that picturebox1 goes away after its wav file is
played as it should, but the screen remains blank until all the wav
files are played and then the last picturebox is displayed. None of
the intermediate pictureboxes are displayed while the associated wave
file is playing. Any suggestions on how to fix this? Thanks.

Jul 31 '07 #1
0 1074

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Joe Thompson | last post: by
reply views Thread by akh | last post: by
reply views Thread by Jerry West | last post: by
2 posts views Thread by =?Utf-8?B?RU1hbm5pbmc=?= | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.