title: Changing a control's property via delegate
body: <p>I am not sure on why this code works when called from the UI thread, but not otherwise:</p>
  
  <pre><code>Delegate Sub CtrlPropertyChangeDelegate(ByRef ControlProperty As Object, ByVal NewValue As Object)
  
  Sub CtrlPropertyChange(ByRef ControlProperty As Object, ByVal NewValue As Object)
  
      If Me.InvokeRequired Then
          Me.Invoke(New CtrlPropertyChangeDelegate(AddressOf CtrlPropertyChange), ControlProperty, NewValue)
      Else
          ControlProperty = NewValue
      End If
  
  End Sub
  </code></pre>
  
  <p>It's supposed to take a control's property (such as Form1.Text) and change its value. Any help would be appreciated</p>