The problem is that your code is all executing on the main thread: the UI thread. And that means that Paint messages aren't responded to until your method ends - by which time the progress bar is at the end.
The solution is to move the long running code onto a separate thread (use a
BackgroundWorker Class[
^] and it has a Progress reporting mechanism you can use to update your ProgressBar.
Give it a try, it's pretty simple to do once you get the hang of it and the link provides example code.