title: PictureBox doesn't display dynamically-generated Bitmap
body: <p>In a Visual Basic .NET Windows Forms application, I am creating Bitmap objects from raw EGA data and trying to display them in PictureBox controls. It can create the objects fine, as I determined by using the Immediate window to call GetPixel. <code>SixteenColorBitmap</code> is a class from a library I am using.</p>
  
  <pre><code>Function TileImage(Tile As SixteenColorBitmap) As Bitmap
      Dim b As New Bitmap(32, 32)
      For y = 1 To 16
          For x = 1 To 16
              Dim t = Tile.Color(x - 1, y - 1)
              Dim c As Color = Drawing.Color.FromArgb(RGB(t.Item1, t.Item2, t.Item3))
              b.SetPixel((x - 1) * 2, (y - 1) * 2, c)
              b.SetPixel((x - 1) * 2 + 1, (y - 1) * 2, c)
              b.SetPixel((x - 1) * 2, (y - 1) * 2 + 1, c)
              b.SetPixel((x - 1) * 2 + 1, (y - 1) * 2 + 1, c)
          Next
      Next
      Return b
  End Function
  </code></pre>
  
  <p>On loading the EGA graphics, that is called for each tile and the result stored in a list. When the user selects a tile, it should pull the right tile ID out of that list and assign it to the <code>Image</code> property of that PictureBox, like this:</p>
  
  <pre><code>TileBackground.Image = BackgroundTiles(SelTile(0))
  </code></pre>
  
  <p>(<code>TileBackground</code> is a PictureBox, <code>BackgroundTiles</code> is the list of GDI+ bitmaps, and <code>SelTile</code> is the array of selected tiles.) When that code runs, as I am sure it is doing, the bitmap is assigned to the property, but it does not display on the form, even when I call <code>Invalidate</code> or <code>Refresh</code>.</p>