Jim Freer
10-03-2007, 11:32 PM
I have a function to convert comma delimited data to an XML object. In addition to downloading a CSV file, I have provided an option to paste text into a TextArea control and press a button to perform a conversion. If the text is large it can take a few seconds to run and therefore I would like to show a ProgressBar for visual feedback.
Unfortunately I haven’t been able to come up a simple scheme that allows the ProgressBar to update while the conversion function is processing. (Old Visual Basic had a DoEvents function to handle this situation.)
I am convinced I can come up with a way to do this by slicing up the conversion process but it will end up being slower. Before I embark on that I was hoping to get some advice on how to do this. Maybe I’m not using the ProgressBar properly?
I set the ProgressBar’s mode property to “manual” and I call its setProgress function. I have tried it from a timer event, turned the function into a class that implements IEventDispatcher and dispatch events and even call setProgress directly from the function. Along with those I’ve tried the validateNow() function.
Unfortunately I haven’t been able to come up a simple scheme that allows the ProgressBar to update while the conversion function is processing. (Old Visual Basic had a DoEvents function to handle this situation.)
I am convinced I can come up with a way to do this by slicing up the conversion process but it will end up being slower. Before I embark on that I was hoping to get some advice on how to do this. Maybe I’m not using the ProgressBar properly?
I set the ProgressBar’s mode property to “manual” and I call its setProgress function. I have tried it from a timer event, turned the function into a class that implements IEventDispatcher and dispatch events and even call setProgress directly from the function. Along with those I’ve tried the validateNow() function.