Pero ahora no se como introducirle el porcentaje desde fuera de la funcion.
Código:
Public Function ListView_AddProgressBar(ByRef pListView As System.Windows.Forms.ListView, ByVal ListViewItemIndex As Integer, ByVal ColumnIndex As Integer) As System.Windows.Forms.ProgressBar
Dim r As Rectangle
Dim pb As New System.Windows.Forms.ProgressBar
r = pListView.Items(ListViewItemIndex).Bounds()
r.Width = pListView.Columns(ColumnIndex).Width
If ColumnIndex > 0 Then
r.X = r.X + pListView.Columns(ColumnIndex - 1).Width
End If
pb.Parent = pListView
pb.SetBounds(r.X, r.Y, r.Width, r.Height)
pb.Visible = True
Return pb
End Function
Dim r As Rectangle
Dim pb As New System.Windows.Forms.ProgressBar
r = pListView.Items(ListViewItemIndex).Bounds()
r.Width = pListView.Columns(ColumnIndex).Width
If ColumnIndex > 0 Then
r.X = r.X + pListView.Columns(ColumnIndex - 1).Width
End If
pb.Parent = pListView
pb.SetBounds(r.X, r.Y, r.Width, r.Height)
pb.Visible = True
Return pb
End Function
Llamo a la funcion asi:
Código:
ListView_AddProgressBar(ListView1, ListView1.Items(0).Index, ListView1.Columns.IndexOf(Progresos))