Software
Java
JavaScript
Delphi
HomeDelphi

Playing A Sound From A Button Click

Click to select the code.  Use Control-C to copy it to your clipboard. Help

Comments

Playing a sound from a button click is easy to do: just call the native PlaySound in the button's OnClick event, as above.  Remember you must include MmSystem in the uses clause.  As the sound file is loaded on the fly, it must, of course, be present in the same directory as the application.

This basic technique can add a little sophistication to even simple applications by adding one or more sounds for various buttons.

.

Copyright 2001 - 2012 by CodeFoot.com and OECCorp.
The 2012 Evolution™


LegalPrivacyCodeFoot.com is an OEC InterNET Group site.SupportNotices
CodeBrain.com BrainCode.com CodeFoot.com CodeBelly.com CodeLifter.com
PopUpWorks.com Droiddd.com etLux.com OECCorp.com
TrayApps.com DavidSosnowski.com MicroTicker.com