Click here to Skip to main content
14,355,411 members

.NET Audio buttons with professional look

Rate this:
1.35 (25 votes)
Please Sign up or sign in to vote.
1.35 (25 votes)
10 Aug 2003
.NET buttons that used for audio functions - write your own control

Sample Image - AudioButtons.jpg

Introduction

When I wrote a program to play audio files (.wav, mp3) I need add some buttons for playing audio files. Unfortunately, .NET doesn’t have such buttons. As part of study on how to write my own controls, I create these audio buttons including Play, Pause, Rewind, Forward, Stop, ToEnd, ToStart. User can use them just as they are using the standard buttons supplied by VS .NET.

Using the code

Here is one example of how to use the code: <o:p>

1.      Use the project in your own solution: Download the source code, which is a project itself. Unzipped it into your solution folder (this would be better, but you can save them wherever you like) In your Solution Explorer in VS .NET, right click the solution and choose “Add”  and “existing project…”. Choose AudioControls project from where ever you unzipped it, then click Open.<o:p>

2.      Add the AudioControls project as a reference to your own project: Right click your own project other than AudioControls project in Solution Explorer, choose “Add reference …” Then click the tab “Projects”, choose the project the click “Select”, then “OK”.<o:p>

3.      Add AudioButtons into your toolbox: At design mode, click your “Toolbox” and choose one of the tab (say My User Controls or whichever group you want the audiobuttons appear in) Right click the toolbox and choose “Add/Removing Items….” In “.NET Framework Components” tab click “Browse…”, in the new window browse for “AudioButtons.dll”, (normally should be under \bin\debug folder) then click “Open”<o:p>

4.      Now you can use AudioButtons just as you use standard buttons from VS .NET. In Properties window, you can find new properties “Audio Button”: ButtonType (ToStart, Rewind, Play, Pause, Stop, Forward, ToEnd), IconLocation and IconSize. They are self-explaining.<o:p>

Further development

There are several properties could be added to the audio buttons, such as colors, gradient changing modes etc.  You can easily add them by following the example of the code (property part). Hope these buttons are of some useful for you either in using them or in writing your own controls.<o:p>

Thanks

Great thanks to Georgi Atanasov, whose article “Owner-draw button” were firstly studied before I started to write my own controls. Great thanks also goes to Carlos H. Perez and his UtilityLibrary.<o:p>

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Share

About the Author

dallyanzi
Web Developer
United Kingdom United Kingdom
No Biography provided

Comments and Discussions

 
GeneralMute and Click event Pin
Saied Javadi10-Jul-06 6:30
memberSaied Javadi10-Jul-06 6:30 
QuestionHow to play audio files? Pin
crystalice543296113-Aug-03 6:31
membercrystalice543296113-Aug-03 6:31 
AnswerRe: How to play audio files? Pin
above13-Aug-03 7:03
memberabove13-Aug-03 7:03 
AnswerRe: How to play audio files? Pin
Ryan_Roberts13-Aug-03 7:04
memberRyan_Roberts13-Aug-03 7:04 
AnswerRe: How to play audio files? Pin
dallyanzi13-Aug-03 7:53
memberdallyanzi13-Aug-03 7:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Article
Posted 10 Aug 2003

Stats

63.3K views
1.3K downloads
25 bookmarked