Question Progress Bar

ivanpsp

New member
Joined
May 16, 2012
Messages
1
Programming Experience
Beginner
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.
 
Do not use the Graphics object returned by CreateGraphics method for painting. If you want to draw to a control handle its Paint event and use the e.Graphics object provided there. For derived classes override OnPaint instead.
 
Back
Top