title: Ensuring that child controls are created in main UI thread
body: <p>I'm modifying existing WinForms project. The project has UserControl.
  This UserControl has DataSet variable which is set from another part of the program in different thread.</p>
  
  <p>What I want to do is to dynamically add another controls to this control depending on the DataSet.</p>
  
  <p>So, after DataSet is loaded, I'm calling RefreshChildControl function and trying to add my new ChildUserControls to flowLayoutPanel. And that's where the problems begin:). I get the "Cross-thread operation not valid: Control 'ChildUserControl' accessed from a thread other than the thread it was created on" exception. I tried to use if(this.InvokeRequired) and Invoke this method, but it does not help. InvokeRequired on MyUserControl is false.</p>
  
  <p>So, is there any good way of performing such task? Or am I missing something important?</p>
  
  <p>EDIT:</p>
  
  <p>I tried to skip InvokeRequired test and just call this.FindForm().Invoke on this method. I've got "Invoke or BeginInvoke cannot be called on a control until the window handle has been created." exception. And, by the way, when I open another form with this control everything worked fine.</p>