Click here to Skip to main content
Licence 
First Posted 10 Aug 2003
Views 56,016
Bookmarked 24 times

.NET Audio buttons with professional look

By | 10 Aug 2003 | Article
.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:

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.

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”.

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”

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.

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.

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.

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

About the Author

dallyanzi

Web Developer

United Kingdom United Kingdom

Member



Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
GeneralMute and Click event PinmemberSaied Javadi5:30 10 Jul '06  
QuestionHow to play audio files? Pinmembercrystalicetpmc5:31 13 Aug '03  
AnswerRe: How to play audio files? PinsussAbove6:03 13 Aug '03  
AnswerRe: How to play audio files? PinmemberRyan S Roberts6:04 13 Aug '03  
AnswerRe: How to play audio files? Pinmemberdallyanzi6:53 13 Aug '03  

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

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

Permalink | Advertise | Privacy | Mobile
Web02 | 2.5.120517.1 | Last Updated 11 Aug 2003
Article Copyright 2003 by dallyanzi
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid