Horizontal ScrollBar/Seek Bar Code
Use this board to post your code snippets - tips and tricks
5 posts
Page 1 of 1
Hi All
Here is a bit of code you can use with your MediaPlayers, and by adding a Horizontal ScrollBar Component you will be able to Drag the Slider to any position within the Track you are playing cooll;
The best way i found using this was to Change my FORM1 name to Player.vb
I am using a Horizontal Scrollbar ( Renamed to ScrollBar in the Properties )
Set the Maximum value to 100
And my MediaPlayer Component has been ( Renamed to PlayerControl in the Properties )
Player Load Code (Which was Form1 Load before i renamed it )
Easy Huh
Chris
Here is a bit of code you can use with your MediaPlayers, and by adding a Horizontal ScrollBar Component you will be able to Drag the Slider to any position within the Track you are playing cooll;
The best way i found using this was to Change my FORM1 name to Player.vb
I am using a Horizontal Scrollbar ( Renamed to ScrollBar in the Properties )
Set the Maximum value to 100
And my MediaPlayer Component has been ( Renamed to PlayerControl in the Properties )
Player Load Code (Which was Form1 Load before i renamed it )
Code: Select all
PlayBar Scroll Code ( Horizontal Scrollbar after being Renamed )PlayerControl.settings.autoStart = True
PlayerControl.settings.volume = VolumeBar.Value
Code: Select all
And thats it Try
If (PlayerControl.currentMedia.duration <> 0) Then
Dim NewPerc As Double = Convert.ToDouble(PlayBar.Value) / 100
Dim DurationVar As Integer = Convert.ToInt32(PlayerControl.currentMedia.duration * 1000) ' milliseconds
Dim NewPos As Integer = (DurationVar * NewPerc) / 1000
PlayerControl.Ctlcontrols.currentPosition = NewPos
Else
PlayBar.Value = 0
End If
Catch ex As Exception
End Try
Easy Huh

Chris
Hello hungryhounduk,
LOL you must have read my mind, I was just about to hunt through my code to find this because I needed it to test something out.
Good work Derren Brown ;) cooll;
LOL you must have read my mind, I was just about to hunt through my code to find this because I needed it to test something out.
Good work Derren Brown ;) cooll;
Welcome to CodenStuff.com Learn Code, Love Code. Thank you for being a member of the community.
Derren Brown, great name indeed ;P
I like most of the English names, they sound so cool!
Anyway, Interesting to know that you like mountain biking, because I make mountain biking too, it's so exciting!
----- // -----
Now talking about your snippeT:
Hmm I was wondering how you made that bar in your MP3 Player before I saw this, It also helped me understanding how to add scrollbars, not just in MP3 Players but also in other applications
Greets,
Nery
I like most of the English names, they sound so cool!
Anyway, Interesting to know that you like mountain biking, because I make mountain biking too, it's so exciting!
----- // -----
Now talking about your snippeT:
Hmm I was wondering how you made that bar in your MP3 Player before I saw this, It also helped me understanding how to add scrollbars, not just in MP3 Players but also in other applications
Greets,
Nery
lol yay u made this in no time i might make a ipod player simple one can i use this for it?
i will also credit ufor it since this is like a good thing
i will also credit ufor it since this is like a good thing
Hi Codenstuff, Nery, Robby1998
Glad you can make use of it cooll;
It certainly does give a Mp3 Player or Media Application a bit more functionality
Respect
Chris
Glad you can make use of it cooll;
It certainly does give a Mp3 Player or Media Application a bit more functionality
Respect
Chris
5 posts
Page 1 of 1
Copyright Information
Copyright © Codenstuff.com 2020 - 2023