Hey guys,

I am trying to change the paths ta large number of image locations depending on a condition. Those images are ordered in an 6 by 24 matrix. For that I have named the images systematically. With two for loops I would like check whether a condition is met and based on the result change the path to the image, respectively.

My form on which the images are placed is called FormDelta. The 144 images are on this form and I thought I could addres them by defining a string and then use it in the FormDelta properties. However, that seems not to be allowed.

Do you guys know a better approach to my problem? I hope it was clear enough, otherwise I am happy to clarify!

Thanks for your time in advance!
Konfis


I have the following code:
Dim i As Integer 'seat
Dim j As Integer 'row
Dim k As Integer 'service
Dim ImgStr As String

ReDim SeatStatusAR_Act(1 To 6, 1 To 24, 1 To 11)
ReDim SeatStatusAR_Ref(1 To 6, 1 To 24, 1 To 11)

For i = 1 To 6
    For j = 1 To 24
            If SeatStatusAR_Act(i, j, l) < SeatStatusAR_Ref(i, j, l) Then
                ImgStr = "Image" & j & "_" & i
                FormDelta.ImgStr.LoadPicture ("D:\Dropbox\Dropbox\UNI\Thesis\Research\Simulator\Pictures\Red.bmp")
            ElseIf SeatStatusAR_Act(i, j, l) >= SeatStatusAR_Ref(i, j, l) Then
                ImgStr = "Image" & j & "_" & i
                FormDelta.ImgStr.LoadPicture ("D:\Dropbox\Dropbox\UNI\Thesis\Research\Simulator\Pictures\Green.jpg")
            Else
                ImgStr = "Image" & j & "_" & i
                FormDelta.ImgStr.LoadPicture ("D:\Dropbox\Dropbox\UNI\Thesis\Research\Simulator\Pictures\Black.jpg")
            End If
    Next j
Next i