Hi all.
I have a Listbox that I parse in order to Generate a PDF File for each row in Listbox.
Nothing problem is there.
The next is that I want to create a Progressbar, ignorer to know the percentage of the PDF Generation Process.
As you can see I have a label that reveals these percentage. And It works going 0% to 100%
When the current row equals the total of rows, then It shows a Message “PDF’s Generation process succesfully”
The problem becames in the progress bar, I dunno If I’m doing something wrong or what did you suggest.
Because the Progressbar doesn’t work (IN MAC).
IN WINDOWS I CAN SEE THE PROGRESSBAR SUCCESSFULLY
It doesn’t reveal the status progress, When it comes to the end, So the Bar gets full.
That is the code that I’m using:
//Total de Facturas del Listbox
Dim TotLista As Integer = listafacturas.listcount
for i as integer=0 to listafacturas.listcount -1
'Msgbox str(i+1)
//Damos valor a la barra de progreso
'Progressbar1.Value = Percentage
Progressbar1.Maximum = 100
Progressbar1.Value = (i/TotLista)*100
Progressbar1.Refresh
CFDiUUID = listafacturas.CellTag(i, 0)
'Msgbox CFDiUUID
ImprimePDFs(CFDiUUID)
//Este es el valor de porcentaje procesado
//Lo obtenemos dividiendo el item procesado entre el total de filas
//de la lista, el resultado lo multiplicamos por 100.
//Y el resultado de esta operacin le sumamos "1"
Dim Percentage as Integer = ((i/TotLista)*100)+1
//Y asignamos el valor al rtulo de porcentaje
lblPorcentaje.text = str(Percentage) + " % PDF Generados"
lblPorcentaje.Refresh
If i+1 = TotLista Then
Msgbox "PDF's Generation process succesfully"
lblAvanceImportacion.text = ""
lblAvanceImportacion.Refresh
lblPorcentaje.text = ""
lblPorcentaje.Refresh
Progressbar1.Value = 0
End If
Next