PDA

Click to See Complete Forum and Search --> : Mp3 Scrollbar


TanTrazz
Jul 8th, 2001, 05:52 PM
Im making a mp3 player .

Im using windows media player .

I don't want to see the windows mediaplayer. Visible = False

I wanne link the Tracker from the media player to a flatscrollbar or a Slider.

How can i do that

:confused:

Tnx TanTrazzzz

Wak
Jul 11th, 2001, 12:40 AM
I made my own MP3 a little while back, and I used the api though. When I came around to the slider, I just decided to make my own, because it looked better than the default windows substitute, and it was smaller than including an ocx. I still have the code if you want it, you should consider this.??

Optic
Jul 11th, 2001, 10:57 AM
please post the code for your slider. It would be greatly appreciated

TanTrazz
Jul 11th, 2001, 11:03 AM
The Source :rolleyes:

Thats it i don't know how i make that :rolleyes:


Will ya help me Wak :)

Tnx TanTrazz

Wak
Jul 12th, 2001, 01:20 AM
You need these controls
tmrSlider : timer control
imgBack : image control, which the cog slides on
imgSlider : the actual cog which slides, can be a picture
lblTitle : label which shows the current percentage


Option Explicit
Dim xFind As Integer
Private iMax As Integer
Dim blnCheck As Integer
Private iValue As Integer

Event CogMoved()
Event CogMoving()

Private Sub imgSlide_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then xFind = X
RaiseEvent CogMoving
End Sub

Private Sub imgSlide_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If blnCheck = True Then Exit Sub
If Button = 1 Then imgSlide.Move imgSlide.Left + (X - xFind)
End Sub

Private Sub imgSlide_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
RaiseEvent CogMoved
End Sub

Private Sub tmrSlider_Timer()
If imgSlide.Left < 0 Then
imgSlide.Left = 0
blnCheck = True
Else
blnCheck = False
End If

If (imgSlide.Left + imgSlide.Width) > imgBack.Width Then
imgSlide.Left = (imgBack.Width - imgSlide.Width)
blnCheck = True
Else
blnCheck = False
End If

End Sub

Property Get Value() As Double
Dim iAns As Double
Dim iTemp As Double
Dim iPos As Double
iTemp = imgBack.Width / 100
iPos = (imgSlide.Left + (imgSlide.Width / 2)) / iTemp
iTemp = (iMax) / 100
Value = (iPos * iTemp) * 100
If iMax = 0 Then Value = 1
End Property

Property Let Value(i As Double)
If iMax < i Then i = iMax
Dim iAns As Double
Dim iTemp As Double
Dim iPos As Double
iTemp = iMax / 100
iPos = i / iTemp
iTemp = (imgBack.Width - imgSlide.Width) / 100
iValue = i
imgSlide.Left = (iPos * iTemp)
End Property

Property Get Max() As Integer
Max = iMax
End Property

Property Let Max(i As Integer)
iMax = i
End Property

Property Get text() As String
text = lblTitle.Caption
End Property

Property Let text(sText As String)
lblTitle.Caption = sText
End Property

Private Sub UserControl_Initialize()
imgBack.Width = UserControl.Width
UserControl.Height = imgBack.Height
lblTitle.ForeColor = RGB(91, 91, 255)
lblTitle.Left = imgBack.Width / 2 - lblTitle.Width / 2
End Sub

Private Sub UserControl_Resize()
imgBack.Width = UserControl.Width
UserControl.Height = imgBack.Height + 20
lblTitle.Left = imgBack.Width / 2 - lblTitle.Width / 2
End Sub