Use a BackgroundWorker, and update the progressbar from the worker's progresschanged event, which is UI thread safe

If youre on 1.1 .net and dont have a BGW, you can get one by googling; its not part of the framework.
If youre on 1.0, upgrade

If you dont want to upgrade, you can call InvokeRequired on the form itself, and if it is needed, Invoke a method tha tupdates the progressbar. Pointless though, when background worker makes it so nice, and painless