title: Dynamically change button background color in vb.net
body: <p>I have 3 buttons in my .Net app and I would like to know how I can perform the below code dynamically. </p>
  
  <p>Public Class frmTC</p>
  
  <pre><code>Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
      Button1.BackColor = Color.Red
      Button2.BackColor = Color.Yellow
      Button3.BackColor = Color.Yellow
  End Sub
  
  Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
      Button1.BackColor = Color.Yellow
      Button2.BackColor = Color.Red
      Button3.BackColor = Color.Yellow
  End Sub
  
  Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
      Button1.BackColor = Color.Yellow
      Button2.BackColor = Color.Yellow
      Button3.BackColor = Color.Red
  End Sub
  
  End Class
  </code></pre>