Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to add sound to a button from mp3 file

Status
Not open for further replies.

WomanPro

Programmer
Nov 1, 2012
180
GR
Hello,
I am having a button and the what I want to do simply, is to play an mp3 file when I click on it.
So I tried
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
My.Computer.Audio.Play(My.Resources.roll_dice, AudioPlayMode.Background)
End Sub

Invalid operation exception was unhandled.
Any suggestions please? What do I miss here? What can I do?
Any help will be much appreciated.

Thank you so much
in advanced.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top