1 Attachment(s)
VB - Add a progress bar as a listview item
I have seen this asked before, but never answered. This will add a progress bar as a listview item. (See image in attachment)
VB Code:
Option Explicit
Dim itmX As ListItem
Dim i As Integer
Dim j As Integer
Private Declare Function SetParent _
Lib "user32" _
(ByVal hWndChild As Long, _
ByVal hWndNewParent As Long) As Long
Private Sub Form_Load()
pbrStatus.Max = 4000
pbrStatus.Value = 0
pbrStatus.Visible = False
SetParent pbrStatus.hWnd, lvwExample.hWnd
End Sub
Private Sub cmdGo_Click()
pbrStatus.Visible = True
lvwExample.ListItems.Clear
For j = 1 To 10
pbrStatus.Value = 0
Set itmX = lvwExample.ListItems.Add
itmX.Text = "Downloading File " & Format(j, "00000")
lvwExample.ListItems.Item(lvwExample.ListItems.Count).Selected = True
lvwExample.SelectedItem.EnsureVisible
itmX.SubItems(1) = "Completed"
With pbrStatus
.Move itmX.Left + lvwExample.ColumnHeaders(1).Width, itmX.Top, itmX.Width, itmX.Height
.Width = lvwExample.ColumnHeaders(2).Width
.Height = itmX.Height
End With
For i = 1 To 4000
pbrStatus.Value = i
DoEvents
Next i
Next j
pbrStatus.Visible = False
pbrStatus.Value = 0
End Sub
Private Sub cmdExit_Click()
Unload Me
End Sub
Re: VB - Add a progress bar as a listview item
does it realy download thing ?
Re: VB - Add a progress bar as a listview item
Quote:
Originally Posted by tony007
does it realy download thing ?
um . . . . did you look at the code? It does not download anything, it is simply an example of how to display a progress bar as a listview item. The "now downloading" text was just an example of an instance where this type of code could be used.
Re: VB - Add a progress bar as a listview item
Quote:
Originally Posted by Armbruster
um . . . . did you look at the code? It does not download anything, it is simply an example of how to display a progress bar as a listview item. The "now downloading" text was just an example of an instance where this type of code could be used.
well it was nice if it had the feture to download . I wonder how that can be don . For example you give it a series of song urls and it goes download the songs from and track prograss of each download. I be happy if u show me how that can be done.Thanks