title: Changing backround color of button when click on the radio button in vb.net
body: <p>I have an online exam form where there are questions with a number and four radio buttons with answers. And also button which I created at runtime. Remaining control which I created at design time.</p>
  
  <p>The main problem is that I want to change the button background color when I click an answer, i.e. radio button. Suppose if the question is 10 then the button number 10 color will be changed when I click the 10 answer, i.e. click on the radiobutton.</p>
  
  <pre><code>Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
      RadioButton1.Checked = False
      Dim i As Integer
      For i = 1 To 5
  
          Dim b1 As New Button
          b1.Name = "butt" &amp; i
          b1.Width = 30
          b1.Height = 30
          b1.Text = i
          b1.Location = New Point(xpos, ypos)
          xpos += 45
          Me.Controls.Add(b1)
          AddHandler b1.Click, AddressOf BuyPizzaHandler
      Next
  End Sub
  </code></pre>