title: Vb.Net - Class to Change Textbox BackColor Dynamically
body: <p>I'd like to know how to create a Class to change each textbox BackColor inside a Form.
  To be more Specific:</p>
  
  <ol>
  <li>When the textbox Is Empty, the textbox BackColor equals White.</li>
  <li>When the textbox Get focus, the textbox BackColor change.</li>
  <li>When the textbox have any text, the textbox BackColor change.</li>
  <li>When the textbox Lost focus, the textbox BackColor change.</li>
  </ol>
  
  <p>At the moment, I'm doing it this way.</p>
  
  <pre><code>Private Sub tb_Login_Enter(sender As Object, e As EventArgs) Handles tb_Login.Enter
      tb_Login.BackColor = Color.LightCyan
  End Sub
  
  Private Sub tb_Login_Leave(sender As Object, e As EventArgs) Handles tb_Login.Leave
      If tb_Login.Text &lt;&gt; "" Then
          tb_Login.BackColor = Color.LightGreen
      Else
          tb_Login.BackColor = Color.White
      End If
  </code></pre>
  
  <p>But, I have many TextBox in my from, so, how can I create a Class for it?</p>
  
  <p>Thanks</p>