Results 1 to 5 of 5

Thread: [RESOLVED] Making a progressbar's length equal to music length ?

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    May 2008
    Location
    Denmark
    Posts
    178

    [RESOLVED] Making a progressbar's length equal to music length ?

    How can i make a progressbars length the same as the music's length ?
    Like if the song is halfways the progressbar is halfways.

    progress = progressbar1
    player = axWindowsMediaPlayer
    vb.net Code:
    1. ' Hardcoded maximum, because i know the length of the song...
    2. Progress.Maximum = 269
    3. ' setting the value to the current time
    4. Progress.Value = player.Ctlcontrols.currentPosition

    But how do i loop it so it is synchronized with the song ?
    Last edited by Link; May 18th, 2008 at 03:04 AM.

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [2008] Making a progressbar's length equal to music length ?

    You'd Start a Timer and on every Tick you'd repeat that second line.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    May 2008
    Location
    Denmark
    Posts
    178

    Re: [2008] Making a progressbar's length equal to music length ?

    Nice thanks im looking into it...

    But when im doing timer.enabled = true, i get some error saying System.NullReferenceException was unhandled, and a error on danish...

  4. #4
    Frenzied Member obi1kenobi's Avatar
    Join Date
    Aug 2007
    Posts
    1,091

    Re: [2008] Making a progressbar's length equal to music length ?

    Try writing timer1.Enabled = True.
    Please rate helpful ppl's posts. It's the best 'thank you' you can give

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    May 2008
    Location
    Denmark
    Posts
    178

    Re: [2008] Making a progressbar's length equal to music length ?

    i made the variable as timer so no But its fixed now, thanks for the help

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