BDeveloper
BDeveloper

Reputation: 1287

Playing sound while displaying a splash screen?

I want to play a sound while my splash screen gets data from the server.

The sound file is not too large. I want something like when you start your computer you hear the MSWinXP welcome sound and that while establishing your account.

How can I do that?

thnx

Upvotes: 1

Views: 1315

Answers (1)

Gant
Gant

Reputation: 29889

Use System.Media.SoundPlayer. You may need to put this code in Form_Load instead.

    private void button1_Click(object sender, EventArgs e)
    {
        System.Media.SoundPlayer player = new System.Media.SoundPlayer();
        player.SoundLocation = @"C:\Windows\Media\chimes.wav";
        player.Play();
    }

Upvotes: 2

Related Questions