CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Hybrid View

  1. #1
    Join Date
    Aug 2009
    Posts
    3

    how to make a slider control to "slide" automatically while playing an mp3 file

    hello, i am making an mp3 player and i have this code which works fine when i'm trying to set the position of the current playing file.

    what i don't know is how to make the slider control to automatically slide when i click the play file.

    this is the code i have:

    DoubleAnimation animatie = new DoubleAnimation();
    animatie.Duration = player.NaturalDuration;
    player.Pause();
    player.Position = TimeSpan.FromSeconds(slider_position.Value);
    player.Play();
    if (player.NaturalDuration.HasTimeSpan)
    {
    slider_position.Minimum = 0;
    slider_position.Maximum = player.NaturalDuration.TimeSpan.TotalSeconds;
    }


    i hope i made myself clear enough

  2. #2
    Join Date
    Aug 2009
    Posts
    3

    Re: how to make a slider control to "slide" automatically while playing an mp3 file

    i forgot to mesnion that i am using WPF

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured