VB6 Progress Bar - Resetting Maximum Value
I've set up a sim开发者_如何学编程ple progress bar in a VB6 form using the Microsoft Common Controls 6.0 component, and everything seems to work correctly.
However, I use the progress bar for several different parts of the form, each of which use different (and variable) maximum values. When I try to change the maximum value at run-time after the bar has already been used once, I get the error Run-time error '380': Invalid Property Value
. The progress bar's value is already reset to the minimum before trying to change the max value.
Do these progress bars not allow their max values to be changed after use, or is there some reset method that I'm missing?
prgLoading.Min = 1
prgLoading.Max = positions.Count
The second line throws the error, and the exact same code is used earlier without any problems.
You can still reset the Min and Max properties. Setting Min higher than the Max or vice-versa will cause a 380 error. You should double check your positions.Count value.
just set prgloading.value=prgloading.min
before setting prgloading.max
精彩评论