Click here to Skip to main content
15,890,825 members
Home / Discussions / C#
   

C#

 
AnswerRe: About the ProgressBar of c# Pin
Dalek Dave13-Mar-11 23:16
professionalDalek Dave13-Mar-11 23:16 
GeneralRe: About the ProgressBar of c# Pin
songguohui15-Mar-11 2:14
songguohui15-Mar-11 2:14 
AnswerRe: About the ProgressBar of c# Pin
Thomas Krojer13-Mar-11 23:18
Thomas Krojer13-Mar-11 23:18 
GeneralRe: About the ProgressBar of c# Pin
songguohui15-Mar-11 2:12
songguohui15-Mar-11 2:12 
AnswerRe: About the ProgressBar of c# Pin
Luc Pattyn13-Mar-11 23:44
sitebuilderLuc Pattyn13-Mar-11 23:44 
GeneralRe: About the ProgressBar of c# Pin
songguohui15-Mar-11 2:13
songguohui15-Mar-11 2:13 
GeneralRe: About the ProgressBar of c# Pin
Luc Pattyn15-Mar-11 2:23
sitebuilderLuc Pattyn15-Mar-11 2:23 
AnswerRe: About the ProgressBar of c# Pin
Keith Barrow13-Mar-11 23:52
professionalKeith Barrow13-Mar-11 23:52 
The progress bar is as precise as you make it, the trick is to start with the following:

//PsuedoCode
progressBar.Minimum = 0; 
progressBar.Maximum = mediaPlayer.PlayTime; //Or however you did this, you could work in ms instead
progressBar.Value = 0;


If the wave player measures in milliseconds, all the better, you will get a more accurate bar.Update the progress bar more often if you want better resolution (say every 100ms), this won't effect performance unduly with the timer. You should be able to do the following on each tick:

progressBar.Value = mediaPlayer.CurrentTime; //There should be a property like this: the current time position in the wav file


If such a property does not exist on the class you are using to play the wav file, you will have to increment by the tick amount. The media player class probably has and event for the player finishing, if so you should call progressBar.Value = mediaPlayer.CurrentTime; when this event is fired, or just set it to the "PlayTime" property, this will fix you initial problem.

Finally, if the player is paused, you should stop the timer and set the current time again. One suggestion is to use a slider instead so the user can move through the file, obivously you will need to be able to set the current time to do this.

GeneralRe: About the ProgressBar of c# Pin
songguohui15-Mar-11 2:13
songguohui15-Mar-11 2:13 
GeneralRe: About the ProgressBar of c# Pin
Keith Barrow15-Mar-11 3:26
professionalKeith Barrow15-Mar-11 3:26 
QuestionWith Asp Running Program Change Excel Setting Pin
khoshrodi13-Mar-11 20:13
khoshrodi13-Mar-11 20:13 
AnswerRe: With Asp Running Program Change Excel Setting Pin
Pete O'Hanlon14-Mar-11 8:03
mvePete O'Hanlon14-Mar-11 8:03 
QuestionHow can i read xml type string from database? Pin
buffering8313-Mar-11 20:02
buffering8313-Mar-11 20:02 
AnswerRe: How can i read xml type string from database? [modified] Pin
Tarun.K.S13-Mar-11 21:59
Tarun.K.S13-Mar-11 21:59 
QuestionGet Remote server sub directories Pin
vishnukamath13-Mar-11 19:46
vishnukamath13-Mar-11 19:46 
AnswerRe: Get Remote server sub directories Pin
JP_Rocks27-Mar-11 0:34
JP_Rocks27-Mar-11 0:34 
QuestionValidate User ID/ password on windows form Pin
shivamkalra13-Mar-11 15:07
shivamkalra13-Mar-11 15:07 
AnswerRe: Validate User ID/ password on windows form Pin
Luc Pattyn13-Mar-11 15:46
sitebuilderLuc Pattyn13-Mar-11 15:46 
GeneralRe: Validate User ID/ password on windows form Pin
shivamkalra13-Mar-11 16:22
shivamkalra13-Mar-11 16:22 
AnswerRe: Validate User ID/ password on windows form Pin
Luc Pattyn13-Mar-11 16:36
sitebuilderLuc Pattyn13-Mar-11 16:36 
GeneralRe: Validate User ID/ password on windows form Pin
GenJerDan13-Mar-11 18:10
GenJerDan13-Mar-11 18:10 
GeneralRe: Validate User ID/ password on windows form Pin
shivamkalra13-Mar-11 20:10
shivamkalra13-Mar-11 20:10 
GeneralRe: Validate User ID/ password on windows form Pin
GenJerDan14-Mar-11 13:14
GenJerDan14-Mar-11 13:14 
GeneralRe: Validate User ID/ password on windows form Pin
shivamkalra14-Mar-11 17:46
shivamkalra14-Mar-11 17:46 
GeneralRe: Validate User ID/ password on windows form Pin
GenJerDan15-Mar-11 3:59
GenJerDan15-Mar-11 3:59 

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.