suresh2k61

Create a winform. Drop the progressbar onto the page. and a button.
In
the button click event add the following text.
progressBar1.Maximum = 100;
progressBar1.Minimum = 0;
for (int f=0; f<100; f++)
{
progressBar1.Value = f;
System.Threading.Thread.Sleep(100);
}
Without knowing the types of i and testpoint I can't figure out the
logic if (i /7 = testpoint). I assume you want to update the progress
bar every 7th line. (That's my assumption I'm using)
My normal problems with the progressBar is:
1. Not setting the maximum to the right value. In your case you may
have 7000 lines, and with your algorithm the bar will show to 100%
after 700 lines of text (i think). By default bar has a maximum of
100. Hence it will quickly get 100% despite only processing 10% of
the
files.
2. The sheer speed of the processing gets to 100% before you can see
it. (hence the sleep above for you to see it but not recommended
unless you want to later on sell them a quicker version of the
software :o)
Prov.
Does this help
On Mar 7, 4:06 pm, sruss...@lotmate.com wrote:
I have a typical VB.net app that is loading legacy data.
All code is in the button click, bad vb coders, and I can't get the
visual
update on the winForm to happen from a do while loop.
' Read the next line
lLine = _lRStream.ReadLine
i += 1
testpoint = i / 7
If (i / 7 = testpoint) Then
Me.ProgressBar1.Value = i
Me.ProgressBar1.Refresh()
'Me.Label6.Refresh()
End If
As you can see I did the Label attempt and no luck with that method
either
Why will my GUI only show the 100% mark and not anything between 0
& 100