BackgroundWorker question

S

Seth Williams

I know how to update a status bar using the ProgressChanged event, if all
the processes are in the form.

However, I have a separate class, which does a recursive file copy. In that,
I'd like to update the status bar as each file is addressed. (I have several
places in classes, I'd like to use in order to change the status on the
status bar)
I tried to create a global variable for status, change the variable when
each file was addressed, and then in the ProgressChanged event assign that
global variable to the text of the status bar label, but that didn't work:
sbLblFiles.text=gsStatus

When debugging, the status variable is changed, but it doesn't get reflected
in the status bar.

I also tried making the BackgroundWorker component public, so I could
possibly refer to it in the classe, but that's apparently not possible
either.

Any ideas?
 
T

Thiago Macedo

I know how to update a status bar using the ProgressChanged event, if all
the processes are in the form.

However, I have a separate class, which does a recursive file copy. In that,
I'd like to update the status bar as each file is addressed. (I have several
places in classes, I'd like to use in order to change the status on the
status bar)
I tried to create a global variable for status, change the variable when
each file was addressed, and then in the ProgressChanged event assign that
global variable to the text of the status bar label, but that didn't work:
sbLblFiles.text=gsStatus

When debugging, the status variable is changed, but it doesn't get reflected
in the status bar.

I also tried making the BackgroundWorker component public, so I could
possibly refer to it in the classe, but that's apparently not possible
either.

Any ideas?

check out this threads:
http://groups.google.com.br/group/m...read/thread/378c7a63102674e1/796345fb67f1694e
solutioned:
http://groups.google.com.br/group/m...read/thread/bed23beb9f7a20c9/ee5acbf0ae15e871

Thiago
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top