title: How to automatically append to RichTextBox in Visual Basic
body: <p>I tried Google for an answer but didn't find what I was looking for.</p>
  
  <p>I created a very simple app that lets users use a barcode scanner to scan barcodes into a text file. Everything works fine, I just want to simplify it a bit more.</p>
  
  <p>Originally, I have a textbox1.text field where the scanned barcode would appear, then the user had to click the 'Add' button (Button1.Click) I placed next to the textbox field to append the barcode serial into a RichTextBox right below. Well the user found it tedious to have to click the 'Add' button every time they scanned an individual barcode. </p>
  
  <p><strong>My Question</strong></p>
  
  <p>Is there a way I can have the text in textbox1.text automatically append to RichTextBox as soon as a barcode is scanned? I want to eliminate having to click the 'Add' button.</p>
  
  <p>Here is my current code (code for the Button1.Click button):</p>
  
  <pre><code>Dim scanData As String = TextBox1.Text
  
  RichTextBox1.AppendText(scanData + " " + Format(TimeOfDay, "HH:mm:ss") + vbNewLine)
  
  TextBox1.Clear()
  TextBox1.Focus()
  </code></pre>