title: How to invoke code for use in a thread
body: <p>Hi I want to use my code below for a thread. I have some example code for invoke but I dont know how to do it when it comes to my combo box selected item going to string.</p>
  
  <p>This is what I have:  </p>
  
  <pre><code>//My code
  string cb1 = comboBox1.Items[comboBox1.SelectedIndex].ToString();
  
  //Example 1
  textBox2.Invoke((Action)(() =&gt; textBox2.Text = ""));
  
  //Example 2
  textbox2.Invoke((MethodInvoker)(delegate()
  {
      //do something
  }));
  </code></pre>