3
Reply

Show progressbar from other class

Pablo Costa

Pablo Costa

Mar 9 2016 10:10 AM
392
 I've a class with all my methods implemented , doing its job , etc.
Then i have my Form1 - where i have a FileSystemWatcher component and some buttons\checkboxes instances.
I've been reading about BackgroundWorker , ProgressBar , but i can't figure out who should i implement in order to show the progress.
Since "everything happens" inside the .cs file (my class), is there an way to display its output ? And how is the FileSystemWatcher going to interact with it (everything happens after i call the watch method - before that nothing is done).
example:
On my class, i've a function to Read Files , then another function for converting those files to XML. I would like to show the progress for each file being readed, then each file being converted. I got it done when i had a Console Application (found an method that did its job) but i can't understand how to implement it on a WinForm application.
If everything was inside the Form1.cs code sure it would be easier.
Thanks

Answers (3)