I've got a 2D array of 100 labels in a 10x10 matrix (it's 2D because it represents some hardware out in the real world, if anyone cares). I want to loop through and check a conditional, and change the label background color if the conditional is false.
I've tried this ten different ways, but I keep getting an exception thrown because the temp variable I have created won't take an assignment to one of the label names.
'Table for correct switch module for corresponding actuator
Dim ActLabelLookup(,) As Label =
{{MTA91, MTA92, MTA93, MTA94, MTA95, MTA96, MTA97, MTA98, MTA99, MTA100},
{MTA81, MTA82, MTA83, MTA84, MTA85, MTA86, MTA87, MTA88, MTA89, MTA90},
{MTA71, MTA72, MTA73, MTA74, MTA75, MTA76, MTA77, MTA78, MTA79, MTA80},
{MTA61, MTA62, MTA63, MTA64, MTA65, MTA66, MTA67, MTA68, MTA69, MTA70},
{MTA51, MTA52, MTA53, MTA54, MTA55, MTA56, MTA57, MTA58, MTA59, MTA60},
{MTA41, MTA42, MTA43, MTA44, MTA45, MTA46, MTA47, MTA48, MTA49, MTA50},
{MTA31, MTA32, MTA33, MTA34, MTA35, MTA36, MTA37, MTA38, MTA39, MTA40},
{MTA21, MTA22, MTA23, MTA24, MTA25, MTA26, MTA27, MTA28, MTA29, MTA30},
{MTA11, MTA12, MTA13, MTA14, MTA15, MTA16, MTA17, MTA18, MTA19, MTA20},
{MTA1, MTA2, MTA3, MTA4, MTA5, MTA6, MTA7, MTA8, MTA9, MTA10}}
Private Sub UpdateActuatorStatus()
Dim X As Integer
Dim Y As Integer
Dim CurrAct As New Label
For X = 0 To (ActControl.MAX_X - 1)
For Y = 0 To (ActControl.MAX_Y - 1)
If TempFunctionalActuatorMatrix(X, Y) = False Then
CurrAct = ActLabelLookup(X, Y)
CurrAct.BackColor = Color.Firebrick
End If
Next
Next
End Sub
With this code, CurrAct is never getting set to anything. Anyone see what I'm doing wrong?

ActControl.MAX_X - 1andActControl.MAX_Y - 1to ensure that it does not exceedActLabelLookup.GetUpperBound(0)andActLabelLookup.GetUpperBound(1), respectively. What is the actual error message.