title: How can I programmatically add a Context Menu Strip to all controls on a win Form in c#
body: <p>I have a Context Menu Strip (contextColorOptions) that allows the ability to change the background color and forecolor of whatever sourcecontrol accessed the Context Menu Strip.</p>
  
  <pre><code>    private void backgroundColorToolStripMenuItem_Click(object sender, EventArgs e)
      {
          if (colorDialog1.ShowDialog() == DialogResult.OK)
          {
              contextColorOptions.SourceControl.BackColor = colorDialog1.Color;
          }
      }
  
      private void textColorToolStripMenuItem_Click(object sender, EventArgs e)
      {
          if (colorDialog1.ShowDialog() == DialogResult.OK)
          {
              contextColorOptions.SourceControl.ForeColor = colorDialog1.Color;
          }
      }
  
      private void resetColorsToolStripMenuItem_Click(object sender, EventArgs e)
      {
          contextColorOptions.SourceControl.BackColor = DefaultBackColor;
          contextColorOptions.SourceControl.ForeColor = DefaultForeColor;
      }
  </code></pre>
  
  <p>I want to be able to assign every control in my form to have the same context menu strip.</p>
  
  <p>I tried this:</p>
  
  <pre><code>        foreach (Control cntrl in this.Controls)
          {
              cntrl.ContextMenuStrip = contextColorOptions;
          }
  </code></pre>
  
  <p>But that didn't seem to work. does anyone have any ideas?
  Thank you in advance!</p>