Posts

Showing posts from October 18, 2012

Visual Basic .Net - Button Sound / Music Play

Image
Visual Basic 2010 - Button Sound Visual Basic 2010 - Play sound on buttons The code is simply goes like this You can copy and paste in your (Click_Event) or whatever it is you wish (MouseClick - MouseHover - MouseLeave) : Dim  MySound  As   New  System.Media.SoundPlayer()     MySound.SoundLocation =  "path to the .Wav file" MySound.Load() MySound.Play() ' OR you can use this : Sub PlaySystemSound() My.Computer.Audio.PlaySystemSound( System.Media.SystemSounds.Asterisk)   End Sub Background playing   It lets the application execute other code while the sound plays. The My.Computer.Audio.Play method allows the application to play only one background sound at a time; when the application plays a new background sound, it stops playing the previous background sound. You c