title: Change Backcolor of button, based on Button name
body: <p>I'm currently writing a program for laboratory weighing.
  On my form there is a grid of 42 positions (7 rows of 6 samples = 1 rack), where each position is a button, with name "Buttonxx" (where xx stands for position number, e.g. Button01, Button02, ... , Button42)</p>
  
  <p>All the information comes from a Oracle Database, through an SQL.</p>
  
  <p>I want to change the Backcolor of specific button based on a piece of information that is returned by the SQL, namely if that sample has to be weighed or not (ToDo = "Y" or "N") for a certain laboratory analysis (= "TitrType" in code)</p>
  
  <p>E.g. In the code below, if for a certain rack only position 23 needs to be weighed (ToDo= "Y") for TAN (= analysis/TitrType), then only the backcolor of that button ("Button23") should be changed to LightSkyBlue</p>
  
  <p>I get the correct information from the SQL and am able to change the name of a virtual button into the name of the position that is ToDo: DummyBtn.Name = "Button23"</p>
  
  <p>But the Backcolor doesn't change for some reason.</p>
  
  <p>p.s.: I'm only novice programmer, so feel free to ask for more code or information if you need it.</p>
  
  <pre><code>Public Sub PrFillSampleGrid(TitrType As String, ByRef RS As System.Data.DataSet)
          Dim Pos As Integer = 0
          Dim TODO As String = ""
  
             For x = 0 To RS.Tables("test").Rows.Count - 1
              Pos = RS.Tables("test").Rows(x).Item("SERIESPOS")
              TODO = RS.Tables("test").Rows(x).Item("TODO")   
              For y = 1 To 42
                  Dim DummyBtn As New Button
                  Select Case TODO.ToUpper
                      Case TODO = "YES", "Y"
  
                          If y = Pos Then
                              DummyBtn.Name = "Button" &amp; y
                              Select Case TitrType
                                  Case Is = "AcIn"
                                      DummyBtn.BackColor = Color.Orange
                                  Case Is = "TAN"
                                      DummyBtn.BackColor = Color.LightSkyBlue
                                  Case Is = "TBN"
                                      DummyBtn.BackColor = Color.Crimson
                                  Case Is = "TBN2"
                                      DummyBtn.BackColor = Color.Yellow
                              End Select
                          End If
                      Case TODO = "NO", "N"
                          DummyBtn.BackColor = SystemColors.Control
                  End Select
              Next y
          Next x
      End Sub
  </code></pre>