Questions tagged [textchanged]

An event that occurs when the text/content of a UI element has changed.

Definition:

The TextChanged event is an event that occurs when the text or content of a UI element has changed.

Most of the time this will be the text/content of a textbox. In general this event is not bound to a specific language or framework. The event can be captured in .NET, JAVA, JavaScript, ...

Examples:

  • .NET

    • WindowsForms

      TextBox _nameTextBox = new TextBox();
      _nameTextBox.TextChanged += new EventHandler(NameTextBox_TextChanged);
      
      private void NameTextBox_TextChanged(object sender, EventArgs e)
      {
          //Handle event
      }
      
    • WPF

      <TextBox TextChanged="MyTextBox_TextChanged">Default text</TextBox>
      
      private void MyTextBox_TextChanged(object sender, TextChangedEventArgs args)
      {
          //Handle event
      }
      
  • JAVA

    JTextField nameTextField = new JTextField();
    
    nameTextField .getDocument().addDocumentListener(new DocumentListener() {
    
        public void removeUpdate(DocumentEvent e) {
        }
    
        public void insertUpdate(DocumentEvent e) {
        }
    
        public void changedUpdate(DocumentEvent e) {
        }
    }); 
    
  • HTML/JavaScript

    <input type="text" id="name" onchange="nameChanged()">
    
    function nameChanged() {
        var name = document.getElementById("name");
        //Handle event
    }
    

More reading:

287 questions
-2
votes
1 answer
-3
votes
1 answer

Can you help me on textchanged ans copy

Hello I would like to be able to change the text of my txtFiles textbox at each iteration of files when there are several files. And also be able to copy only one file at a time when I want it even if there are several files in the directory. I…
1 2 3
19
20