Results 1 to 5 of 5

Thread: Mp3 Scrollbar

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2001
    Location
    Netherlands
    Posts
    5

    Mp3 Scrollbar

    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



    Tnx TanTrazzzz

  2. #2
    Hyperactive Member Wak's Avatar
    Join Date
    Nov 2000
    Location
    Brisbane, Queensland
    Posts
    298

    An idea??

    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.??
    Visual Basic 6.0 Enterprise
    Visual C++ 6.0 Professional

    Wak

  3. #3
    Lively Member Optic's Avatar
    Join Date
    Mar 2001
    Location
    I'm everywhere and nowhere, I'm inside your computer and inside your mind. You can't escape me for I am vision.
    Posts
    117
    please post the code for your slider. It would be greatly appreciated

  4. #4

    Thread Starter
    New Member
    Join Date
    Jul 2001
    Location
    Netherlands
    Posts
    5
    The Source

    Thats it i don't know how i make that


    Will ya help me Wak

    Tnx TanTrazz
    Runtime eRRor

  5. #5
    Hyperactive Member Wak's Avatar
    Join Date
    Nov 2000
    Location
    Brisbane, Queensland
    Posts
    298

    Thumbs up sure

    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

    Code:
    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
    Visual Basic 6.0 Enterprise
    Visual C++ 6.0 Professional

    Wak

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