Hi; and, first of all, sorry for my English.
I use a Progress Bar with a label on it indicating the rate of progress of reading file operation.
It works well, but at the end of the process the label (indicating 100%) disappears.
If I set a breakpoint at the exit of the loop (in which I read file and upgrade the progress bar status) and stepping manually up the program (with ****+F8) the label doesn’t disappear.
someone can help me? thanks
The code is as follows:
While Not riga Is Nothing
Application.DoEvents()
'*****************************
‘FILE ROW READING (“Riga” upgrade)
'*****************************
If ProgressBar1.Value + Len(riga) < NumeroByte Then
ProgressBar1.Value = ProgressBar1.Value + Len(riga) + 2
Else
ProgressBar1.Value = ProgressBar1.Value + Len(riga)
End If
Per = Int((ProgressBar1.Value / ProgressBar1.Maximum) * 100)
ProgressBar1.CreateGraphics().DrawString(Per & "%", New Font("Arial", 8.25, FontStyle.Bold), Brushes.Black, New PointF(ProgressBar1.Width / 2 - 10, ProgressBar1.Height / 2 - 7))
End While
**********************************
'CONTROLS DEFAULT SETTING AND EXIT SUB
'**********************************
PS. NumeroByte is the file size that I set before while cycle.
I use a Progress Bar with a label on it indicating the rate of progress of reading file operation.
It works well, but at the end of the process the label (indicating 100%) disappears.
If I set a breakpoint at the exit of the loop (in which I read file and upgrade the progress bar status) and stepping manually up the program (with ****+F8) the label doesn’t disappear.
someone can help me? thanks
The code is as follows:
While Not riga Is Nothing
Application.DoEvents()
'*****************************
‘FILE ROW READING (“Riga” upgrade)
'*****************************
If ProgressBar1.Value + Len(riga) < NumeroByte Then
ProgressBar1.Value = ProgressBar1.Value + Len(riga) + 2
Else
ProgressBar1.Value = ProgressBar1.Value + Len(riga)
End If
Per = Int((ProgressBar1.Value / ProgressBar1.Maximum) * 100)
ProgressBar1.CreateGraphics().DrawString(Per & "%", New Font("Arial", 8.25, FontStyle.Bold), Brushes.Black, New PointF(ProgressBar1.Width / 2 - 10, ProgressBar1.Height / 2 - 7))
End While
**********************************
'CONTROLS DEFAULT SETTING AND EXIT SUB
'**********************************
PS. NumeroByte is the file size that I set before while cycle.