Ich habe jetzt einfach mal ein neues einfaches Projekt gemacht, da ist das selbe Verhalten.
Ich hab ne Progressbar, einen Button und ein NumericUpDown zum einstellen der PB.maximum
Wenn der Wert auf 1000 steht füllt sich die PB nicht mal zur Hälfte bei 10000 schon fast bis zum Ende aber halt nicht ganz
Hier der Code, im Anhang das Projekt
Ich hab ne Progressbar, einen Button und ein NumericUpDown zum einstellen der PB.maximum
Wenn der Wert auf 1000 steht füllt sich die PB nicht mal zur Hälfte bei 10000 schon fast bis zum Ende aber halt nicht ganz
Hier der Code, im Anhang das Projekt
VB.NET-Quellcode
- Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
- ProgressBar1.Maximum = NumericUpDown1.Value
- ProgressBar1.Visible = True
- For a As Integer = 1 To NumericUpDown1.Value
- ProgressBar1.Value = a ' / 100
- Button1.Text = ProgressBar1.Value & " / " & ProgressBar1.Maximum
- My.Application.DoEvents()
- ProgressBar1.Refresh()
- Next
- My.Application.DoEvents()
- ProgressBar1.Refresh()
- ProgressBar1.Visible = False
- End Sub