TextBox event for only user input

Check Modified property of TextBox on the TextChanged event. If true, the changes were made by user, otherwise the text was changed programmatically.

Example:

void Texbox_TextChanged(object sender, EventArgs e)
{
    if (((TextBox)sender).Modified)
        TextboxUserInput();
}

You can use the Key Down event of the text box.

  private void textBox1_KeyDown(object sender, KeyEventArgs e)
  {
      // Insert the code you want to run when the text changes here!
  }

my solution work for type , copy and paste

    private void TextChanged(object sender, EventArgs e)
    {
        if (((TextBox)sender).ContainsFocus)
        {

        }
    }

Tags:

C#

Events

Textbox