title: Looping backgroundworker
body: <p>I have a vb.net application that I want to be made a) visible and b) topmost when the activewindow is set to my requirements - this part I have covered off fine.</p>
  
  <p>What I want to be able to do is to use the backgroundworker to actively monitor this on a continuous loop - again I have covered this off fine.</p>
  
  <p>The problem I am having is that when I am selecting a combobox, I cannot make a selection due to interference from the bgw - almost like when I click on the combobox to show the list, the bgw seems to almost do a click away from the combobox closing the list.</p>
  
  <p>Any help would greatly be appreciated.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>Private Delegate Sub progressDelegate()
  
  Private Sub frmApp_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
  
      Me.bgwActiveWindow.RunWorkerAsync()
  
  End Sub
  
  Private Sub bgwActiveWindow_DoWork(ByVal sender As System.Object, ByVal e As System.ComponentModel.DoWorkEventArgs) Handles bgwActiveWindow.DoWork
  
      Dim CheckWindow As progressDelegate
  
      CheckWindow = New progressDelegate(AddressOf SetAppTopMost)
      Me.Invoke(CheckWindow)
  
      System.Threading.Thread.Sleep(100)
  
  End Sub
  
  Private Sub SetAppTopMost()
  
      Dim bol As Boolean
  
      If getActiveWindowTitle.IndexOf("Microsoft Outlook") &lt;&gt; -1 Or _
         getActiveWindowTitle.IndexOf(My.Settings.AppName) &lt;&gt; -1 Then
          bol = True
      Else
          bol = False
      End If
  
      Me.Visible = bol
      Me.TopMost = bol
  
  End Sub
  
  Private Sub bgwActiveWindow_RunWorkerCompleted(ByVal sender As Object, ByVal e As System.ComponentModel.RunWorkerCompletedEventArgs) Handles bgwActiveWindow.RunWorkerCompleted
  
      bgwActiveWindow.RunWorkerAsync()
  
  End Sub
  </code></pre>