title: Changing Background color of Form using string via Textbox
body: <p>I am using the following code so as to get the color of Form's background from user using a TextBox, if the color matches the C# colors, then change the Form background color to what user entered, otherwise it shows a message that the color doesn't exist.</p>
  
  <p>The problem is there is no way to read colors from string consisting the name of colors. So I can't use </p>
  
  <pre><code>Form1.ActiveForm.BackColor = Color.text
  </code></pre>
  
  <p>What can I do to resolve that?</p>
  
  <pre><code>private void button1_Click(object sender, EventArgs e)
  {
    string text = textBox1.Text;
    string[] colors = Enum.GetNames(typeof(System.Drawing.KnownColor));
    for (int i = 0; i &lt; colors.Length; i++)
    {
      if (colors[i] == text)
      {
        // Form1.ActiveForm.BackColor = Color.
        MessageBox.Show("BackGround Color of Form Has Been Changed");
      }
      else
      {
        MessageBox.Show("Color You Entered Does Not Exist");
      }
    }
  }
  </code></pre>