title: Control.Invoke delegates in CF 3.5
body: <p>It seems like everybody have noticed CF is unable to Control.Invoke delegates other than EventHandler type. I found few ways to workaround the problem and catch the arguments trough tricky events and properties, but it works just for certain objects/primitives. </p>
  
  <p>The problem is when I try to send a Control, the program throws an exception at execution time: "Control.Invoke must be used to interact with controls created on a separate thread" no matters that I checked Control.IsInvokeRequired and tracked by handler trough the Invoke method...what hell, there is the snipet:</p>
  
  <pre><code>    static class Program
  {
      [MTAThread]
      static void Main()
      {
          Form1 frm = new Form1();
          frm.modifier = new CModifier(ref frm);
          Application.Run(frm);
      }
   }
  
  class CModifier
  {
      internal event EventHandler Modify;
  
      internal CModifier(ref Form1 _frm)
      { frm = _frm; }
  
      private Form1 frm;
  
      internal void Start()
      {
          Thread t = new Thread(new ThreadStart(TestMe));
          t.Start();
      }
      private void TestMe()
      {
          frm._current = new Label() { Text = "Try Me" };
          Modify(this, EventArgs.Empty);
      }
  
  }
  
  public partial class Form1 : Form
  {
      internal Form1()
      {
          InitializeComponent();
      }
  
      internal CModifier modifier;
      internal Control _current;
  
      private void Form1_Load(object sender, EventArgs e)
      {
          modifier.Modify += new EventHandler(modifier_Modify);
          modifier.Start();
      }
  
      void modifier_Modify(object sender, EventArgs e)
      {
          if (this.InvokeRequired)
          {
              this.Invoke(new EventHandler(modifier_Modify));
          }
          this.panel1.Controls.Add(_current);
      }
  
  }
  </code></pre>
  
  <p>I tried to do in almost every way possible and I always get the same result.</p>
  
  <p>What am I doing wrong? ----> there is a "return;" lost after Invoke.</p>
  
  <p>Anyway, te actual error at my app (above is just an example) is in this procedure:</p>
  
  <pre><code>        internal void ManageControls(RSSDecisionMaking.InterfaceBehaviour _behaviour, Control _control)
      {
          if (this.InvokeRequired)
          {
              this.Invoke((Action)delegate { ManageControls(_behaviour, _control); });
              return;
          }
          switch (_behaviour)
          {
              case RSSDecisionMaking.InterfaceBehaviour.Display:
                  this.pnDisplayContainer.Controls.Clear();
                  this.pnDisplayContainer.Controls.Add(_control);
                  break;
              case RSSDecisionMaking.InterfaceBehaviour.Command:
                  this.pnDisplayContainer.Controls.Clear();
                  this.pnDisplayContainer.Controls.Add(_control);
                  this.pnDisplayContainer.Controls[0].Focus();
                  break;
          }
      }
  </code></pre>
  
  <p>The main difference is in the Invoke stuff, I'm sending a Control from another thread.</p>
  
  <p>Could tell me what the difference it makes? Why this does not work?</p>