I'm trying to create a pretty easy threaded application but I keep getting an error message:

Cross-thread operation not valid: Control '' accessed from a thread other than the thread it was created on.

I am aware that I should only alter the properties of a control from the thread in which it was created on, but I'm not altering the control directly from another thread. This is my current source:

VB Code:
  1. Imports System.IO
  2. Imports System.Threading
  3.  
  4. Public Class MainForm
  5.  
  6.     Private WithEvents _pdfMaker As PDFMaker
  7.  
  8.     Private Sub btnBrowse_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnBrowse.Click
  9.         If (browseDialog.ShowDialog = Windows.Forms.DialogResult.OK) Then
  10.             txtArchiveFilePath.Text = browseDialog.FileName
  11.         End If
  12.     End Sub
  13.  
  14.     Private Sub btnBurnFiles_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnBurnFiles.Click
  15.         _pdfMaker = New PDFMaker
  16.  
  17.         Dim mainThread As Thread = New Thread(AddressOf _pdfMaker.createPdfFromTiffArchive)
  18.         _pdfMaker.ArchivePath = txtArchiveFilePath.Text
  19.         _pdfMaker.TempDir = "C:\test\"
  20.  
  21.         mainThread.Start()
  22.     End Sub
  23.  
  24.  
  25.     Private Sub _pdfMaker_TiffAdded(ByVal percentDone As Double) Handles _pdfMaker.TiffAdded
  26.         currentProgress.Value = percentDone
  27.         txtStatus.Text = "Building PDF File (" & percentDone & "%)"
  28.     End Sub
  29. End Class

The error message is coming from currentProgress.Value = percentDone. currentProgress is an object of type toolStripProgressBar. For some reason though if i comment that line out the next line: txtStatus.Text = "Building PDF File (" & percentDone & "%)" does not trigger an error... any ideas?