title: Why when typing inside the onchangetext event it's not doing anything?
body: <p>When the code in the event TextChanged was inside the event TextBoxURL_KeyDown it was working fine also with the logic i wanted. But then i had to press the enter key,  so i moved it to the TextChanged event but now when i type a valid in the TextBoxUrl nothing happens.</p>
  
  <p>Code:</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.ComponentModel;
  using System.Data;
  using System.Drawing;
  using System.Linq;
  using System.Text;
  using System.Text.RegularExpressions;
  using System.Threading.Tasks;
  using System.Windows.Forms;
  
  namespace DownloadMultipleFiles
  {
      public partial class AddNewDownloads : Form
      {
          public AddNewDownloads()
          {
              InitializeComponent();
  
              foreach (Control ctrl in this.Controls)
              {
                  if ((ctrl as TextBox) != null)
                  {
                      (ctrl as TextBox).TextChanged += TextChanged;
                  }
              }
  
              this.TextBoxURL.KeyDown += new KeyEventHandler(TextBoxURL_KeyDown); //add keyDown event
              if (TextBoxFilename.Text == "" || TextBoxBrowse.Text == "")
              {
                  TextBoxFilename.Enabled = false;
                  TextBoxBrowse.Enabled = false;
                  btnOK.Enabled = false;
              }
          }
  
          private void AddNewDownloads_Load(object sender, EventArgs e)
          {
  
          }
  
          private void btnBrowse_Click(object sender, EventArgs e)
          {
  
          }
  
          private void btnCancel_Click(object sender, EventArgs e)
          {
              this.Close();
          }
  
          private void btnOK_Click(object sender, EventArgs e)
          {
  
          }
  
          private void TextBoxURL_KeyDown(object sender, KeyEventArgs e)
          {
              if (e.KeyCode == Keys.Enter) //validate the URL when you press the Enter key
              {
  
              }
          }
          private bool CheckValidUrl() // validate from clipboard
          {
              string isUrl = Clipboard.GetText();
              Uri uriResult;
              bool result = Uri.TryCreate(isUrl, UriKind.Absolute, out uriResult)
                  &amp;&amp; (uriResult.Scheme == Uri.UriSchemeHttp || uriResult.Scheme == Uri.UriSchemeHttps);
              return result;
          }
          private bool WriteValidUrl() // validate manual input 
          {
              string pattern2 = @"^http://www.[a-z].com$";
              Match match = Regex.Match(TextBoxURL.Text, pattern2);
              if (match.Success)
                  return true;
              else
                  return false;
          }
  
          private new void TextChanged(object sender, EventArgs e)
          {
              if (CheckValidUrl() == true || WriteValidUrl() == true)
              {
                  TextBoxFilename.Enabled = true;
                  TextBoxBrowse.Enabled = true;
                  btnOK.Enabled = true;
              }
              else
              {
                  TextBoxFilename.Enabled = false;
                  TextBoxBrowse.Enabled = false;
                  btnOK.Enabled = false;
              }
              if (TextBoxURL.Text == "")
              {
                  TextBoxFilename.Enabled = false;
                  TextBoxBrowse.Enabled = false;
                  btnOK.Enabled = false;
              }
          }
      }
  }
  </code></pre>