Results 1 to 6 of 6

Thread: Putting a progress bar and an icon into the status bar.

  1. #1

    Thread Starter
    PowerPoster eiSecure's Avatar
    Join Date
    Jul 2000
    Location
    Texas
    Posts
    2,209

    Putting a progress bar and an icon into the status bar.

    How do I draw a progress bar and an icon into the status bar control?

  2. #2
    For an icon, just use the Picture property. Unless you are talking about an *icon*, like .ico, which I don't know if it supports as I only use BMPs in StatusBars.

    Don't think you can do a statusbar with a progress bar in it unless you chuck a picturebox or something on top of it and ZOrder it.

  3. #3
    Guru Aaron Young's Avatar
    Join Date
    Jun 1999
    Location
    Red Wing, MN, USA
    Posts
    2,177
    You can use the SetParent API to make the Statusbar the container for the Progressbar, i.e.
    VB Code:
    1. Private Declare Function SetParent Lib "user32" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long
    2.  
    3. Private Sub Form_Load()
    4.     StatusBar1.Panels.Add , "ICON", , , LoadPicture("C:\Program Files\Microsoft Visual Studio\Common\Graphics\Icons\Misc\Face02.ico")
    5.     ProgressBar1.Move 0, 24, StatusBar1.Panels(1).Width, StatusBar1.Height - 24
    6.     SetParent ProgressBar1.hWnd, StatusBar1.hWnd
    7.     ProgressBar1.Value = 50
    8. End Sub

  4. #4

    Thread Starter
    PowerPoster eiSecure's Avatar
    Join Date
    Jul 2000
    Location
    Texas
    Posts
    2,209
    for the icon, can it be changed to an animated gif?

  5. #5
    Hyperactive Member Jason Badon's Avatar
    Join Date
    Feb 2001
    Location
    Colorado
    Posts
    329
    ei you could add an image list and loop through them to simulate an animated icon.

    VB Code:
    1. Dim Counter As Integer
    2.  
    3. Private Sub Timer1_Timer()
    4.     Counter = Counter + 1
    5.     StatusBar1.Panels(3).Picture = ImageList1.ListImages(Counter).Picture
    6.     If Counter > ImageList1.ListImages.Count - 1 Then Counter = 0
    7. End Sub

  6. #6
    Registered User Nucleus's Avatar
    Join Date
    Apr 2001
    Location
    So that's what you are up to ;)
    Posts
    2,530
    I can't say I think an animated icon in a status bar would look professional.

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