Hello everybody,
(after pressing a button) i would like to show an image (using a picturebox), wait a few seconds and then play a
mp3 sound, but i dont get it to work. To wait a few seconds i use "System.Threading.Thread.Sleep(5000)". The problem is, the image alway appears AFTER the wait time, but i want it to show first, then wait, then play the mp3... i tried to use "WaitOnLoad = true" but it doesnt work, shouldn't it load the image first and the continue to read the next code line ??
Here is the code i've tried, that doesnt work:
private void button1_Click(object sender, EventArgs e)
{
pictureBox1.WaitOnLoad = true;
pictureBox1.Load("image.jpg");
System.Threading.Thread.Sleep(5000);
MessageBox.Show("test"); //just to test, here should be the code to play the mp3
}
(i also tried loading the image with "LoadAsync" and put the code to wait and play the mp3 in the "LoadCompleted" event, but that doesnt work either...)
would be very nice if somebody helps me