Member Avatar

Me and a friend are making an app which we need to play a sound when Form1 is started. How do we do this? I don't mind code.

Recommended Answers

All 2 Replies

The following code will play .wav files.

Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim myCoolSoundFile As String = "C:\!\mission2.wav" '// your sound .wav file here.
        If IO.File.Exists(myCoolSoundFile) Then
            MsgBox("No sound file found.", MsgBoxStyle.Critical)
        End If
    End Sub
End Class
Member Avatar

OK, will try that later.

Thank you!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.