Private Sub Form1_Paint(ByVal sender As Object, ByVal e As PaintEventArgs)
' This will paint the answer
If _solved Then
Dim position As Integer = 0
' Loop through each letter in the top genome and paint the tile
Dim c As Char
For Each c In lblAnswer.Text
position += _tileImage.Width + 5
DrawLetterTile(e.Graphics, position, c.ToString().ToUpper()(0))
Next c
End If
End Sub 'Form1_Paint
Dim _scrabbleFont As New Font(New FontFamily("Arial"), 24, FontStyle.Bold)
Dim _numberFont As New Font(New FontFamily("Arial"), 7, FontStyle.Bold)
Sub DrawLetterTile(ByVal g As Graphics, ByVal position As Integer, ByVal c As Char)
' get the scrabble value for the letter we are painting
Dim num As Integer = CInt(ScrabbleGenome.ScrabblePoints(c))
' determine the position of the wooden tile bitmap
Dim xPosition As Integer = position
Dim yPosition As Integer = ClientRectangle.Height - (_tileImage.Height + 5)
' flip the image 90 degrees each time to show different wood grains
_tileImage.RotateFlip(RotateFlipType.Rotate90FlipX)
' draw the blank tile
g.DrawImage(_tileImage, xPosition, yPosition)
' draw the scrabble letter in the center of the tile
g.DrawString(c.ToString(), _scrabbleFont, Brushes.Black, New Point(xPosition + (_tileImage.Width - CInt(g.MeasureString(c.ToString(), _scrabbleFont).Width)) / 2, yPosition + (_tileImage.Height - _scrabbleFont.Height) / 2))
' draw the scrabble point value in the lower right hand corner of the tile
g.DrawString(num.ToString(), _numberFont, Brushes.Black, New Point(xPosition + _tileImage.Width - 15, yPosition + _tileImage.Height - 15))
End Sub 'DrawLetterTile