visual studio - vb.net progress bar is not valid for 'Value'. 'Value' should be between 'minimum' and 'maximum' -


private sub timer1_tick(byval sender system.object, byval e system.eventargs) handles timer1.tick     if progressbar2.value = 100         progressbar2.value = progressbar2.maximum()         msgbox("posting completed!")         progressbar2.enabled = false     else                     progressbar2.value += 5         loop     end if   end sub 

it's been 3 hour i'm working figure problem is, until still can't find solution this, no error until run it, gives me error

value of '105' not valid 'value'. 'value' should between 'minimum' , 'maximum'. parameter name: value

i set my

progressbar2.minimum = 0 progressbar2.maximum = 100 

please me out :(

something wrong in code above.

the loop

            progressbar2.value += 5     loop 

will never stop , when reaches 100 increment past maximum value.
no, test @ entry of method not executed while inside loop

you should increment 1 time , exit loop , wait next timer tick increment again

private sub timer1_tick(byval sender system.object, byval e system.eventargs) handles timer1.tick     if progressbar2.value + 5 >= progressbar2.maximum         progressbar2.value = progressbar2.maximum         msgbox("posting completed!")         timer1.stop()     else         progressbar2.value += 5     end if end sub 

also, when reach maximum should stop timer1 not disable progressbar2


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -