Results 1 to 10 of 10

Thread: Progress bar in a statusbar

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Apr 2001
    Location
    London, UK
    Posts
    16

    Question

    Anyone know how to get a progress bar in a statusbar like in Internet Explorer?
    VB6 Enterprise (COM, ADO, ActiveX)
    SQL Server 7
    HTML

  2. #2
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390
    Add a Statusbar and a Progress bar..
    Code:
        
    Private Declare Function SetParent Lib "user32" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long
    
    'form load...
    SetParent ProgressBar1.hwnd, StatusBar1.hwnd
       
    With StatusBar1
    Progressbar1.Move 30, 50, .Panels(1).width - 30, .height - 65
    End With
        
    VBBrowser v2.2.1
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Apr 2001
    Location
    London, UK
    Posts
    16

    Thumbs up

    Cool, thanks geoff
    VB6 Enterprise (COM, ADO, ActiveX)
    SQL Server 7
    HTML

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Apr 2001
    Location
    London, UK
    Posts
    16
    Is there any way I can do this with 2 progressbars in the same statusbar? I tried this:

    Code:
    Private Declare Function SetParent Lib "user32" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long
    
    Private Sub Form_Load()
        SetParent prgListProgress.hWnd, sbrStatus.hWnd
        With sbrStatus
            prgListProgress.Move 30, 50, .Panels(1).Width - 30, .Height - 65
        End With
        
        SetParent prgProgress.hWnd, sbrStatus.hWnd
        With sbrStatus
            prgProgress.Move 30, 50, .Panels(2).Width - 30, .Height - 65
        End With
    End Sub
    But it only works for the first progressbar.
    VB6 Enterprise (COM, ADO, ActiveX)
    SQL Server 7
    HTML

  5. #5

    Thread Starter
    Junior Member
    Join Date
    Apr 2001
    Location
    London, UK
    Posts
    16
    Actually, I just noticed that it's putting both progressbars into panel 1, so is there anyway to tell it what panel it should be in?
    VB6 Enterprise (COM, ADO, ActiveX)
    SQL Server 7
    HTML

  6. #6

    Thread Starter
    Junior Member
    Join Date
    Apr 2001
    Location
    London, UK
    Posts
    16

    Cool

    Nevermind, figured it out. Just had to use .Panels(2).Left.
    VB6 Enterprise (COM, ADO, ActiveX)
    SQL Server 7
    HTML

  7. #7
    Fanatic Member
    Join Date
    Aug 2000
    Posts
    736
    Draco,

    Would you mind posting the code you used to get 2 progressBars in the statusBar?

    Thanks.

  8. #8

    Thread Starter
    Junior Member
    Join Date
    Apr 2001
    Location
    London, UK
    Posts
    16
    No prob.

    First put 2 progressbars and a statusbar on the form (as previously mentioned), with 2 panels in the statusbar (just stating the obvious ).

    Code:
    Private Declare Function SetParent Lib "user32" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long
    
    Private Sub Form_Load()
        SetParent prgListProgress.hWnd, sbrStatus.hWnd
        With sbrStatus
            prgListProgress.Move .Panels(1).Left, 50, .Panels(1).Width - 30, .Height - 65
        End With
        
        SetParent prgProgress.hWnd, sbrStatus.hWnd
        With sbrStatus
            prgProgress.Move .Panels(2).Left, 50, .Panels(2).Width - 30, .Height - 65
        End With
    End Sub
    VB6 Enterprise (COM, ADO, ActiveX)
    SQL Server 7
    HTML

  9. #9
    Fanatic Member
    Join Date
    Aug 2000
    Posts
    736
    Thanks !!

    I was close, but not close enough to get it to work right.

  10. #10
    Lively Member HerculesMO's Avatar
    Join Date
    Apr 2001
    Posts
    80
    How do you get this to work with an MDI Parent?

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