472,119 Members | 1,878 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,119 software developers and data experts.

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 1180

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
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.