I believe sourceArray(sourceIndex) does contain text but that is the line I am getting the NullPointerException?Code:For row = 0 To 3 For col = 0 To 4 Dim curLabel As New Label curLabel = Me.TableLayoutPanel1.GetControlFromPosition(row, col) With curLabel If sourceIndex >= sourceArray.Length Then .Text = sourceArray(sourceIndex) .Font = My.Settings.myFont .ForeColor = My.Settings.myForeColor .BackColor = My.Settings.myBackColor End If End With sourceIndex = sourceIndex + 1 Next Next




Reply With Quote