I need to create an array of colours. I have this code but it gives me an error:
An unhandled exception of type 'System.NullReferenceException' occurred in AceMosaic.exe
Additional information: Object reference not set to an instance of an object.VB Code:
Dim colours() As Color Dim c As Control Dim intCount As Integer = -1 For Each c In gpbColours.Controls If TypeOf c Is Label Then If c.Name.Substring(0, c.Name.IndexOf("_")).ToLower = "lblcolour" And c.Text = "X" Then intCount += 1 colours(intCount) = c.BackColor End If End If Next
Can anyone tell me what I am doing wrong.




Reply With Quote