title: cannot invoke a non-delegate type
body: <p>I am trying to use threading  and that includes a GUI controller, so I needed to invoke that controller but I have this problem- I cannot invoke a non-delegate type in this part of the code</p>
  
  <pre><code>if (toolStripTextBox1.Text != "")
  {
      if (RT[j].tabvalue.ToString() == tabControl1.Invoke(() =&gt;
                                         { tabControl1.SelectedTab.Name; }))
      {
          RT[j].RitchT.Text = getH.getHtmlCode(toolStripTextBox1.Text);
      }
  }
  </code></pre>
  
  <p>while this is working on the other hand</p>
  
  <pre><code>tabControl1.Invoke(
      () =&gt; { tabControl1.TabPages[R.RitchT.Name].Controls.Add(R.RitchT);
  });
  </code></pre>
  
  <p>This is the invoke class </p>
  
  <pre><code> public static class ControlExtensions
   {
      public static void Invoke(this Control control, Action action)
      {
          if (control.InvokeRequired)
              control.Invoke(new MethodInvoker(action), null);
          else
              action.Invoke();
      }
   }
  </code></pre>
  
  <p>How can I solve this?</p>